SQL执行顺序
编写顺序
SELECT DISTINCT<select list>FROM<left_table> <join_type>JOIN<right_table> ON <join_condition>WHERE<where_condition>GROUP BY<group_by_list>HAVING<having_condition>ORDER BY<order_by_condition>LIMIT<limit_params>
执行顺序
FROM<left_table>ON <join_condition><join_type>JOIN<right_table>WHERE<where_condition>GROUP BY <group_by_list>HAVING<having_condition>SELECT DISTINCT<select list>ORDER BY<order_by_condition>LIMIT<limit_params>
正则表达式使用
正则表达式(Regular Expression)是指一个用来描述或者匹配一系列符合某个句法规则的字符串的单个字符串。
select * from emp where name regexp '^T';select * from emp where name regexp '2$';select * from emp where name regexp '[uvw]';
如果觉得《MySQL高级 - SQL技巧 - SQL执行顺序及正则表达式》对你有帮助,请点赞、收藏,并留下你的观点哦!