MySQL的操作顺序? [英] MySQL Order of Operations?

查看:77
本文介绍了MySQL的操作顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有确定的位置来查找mySQL语句的操作顺序?以下顺序正确吗?

Is there a definitive place to find order of operations for mySQL statements? Is the below order correct?

FROM子句 WHERE子句 GROUP BY子句 HAVING子句 SELECT子句 ORDER BY子句

FROM clause WHERE clause GROUP BY clause HAVING clause SELECT clause ORDER BY clause

如果是这种情况,我可以在group by子句中使用SELECT类别(将first_name选择为"f_name")中定义的术语吗?

If this is the case, can I use a term defined in the SELECT clase (select first_name as "f_name") within the group by clause?

谢谢!

推荐答案

根据是的,您可以使用在GROUP BY子句中用AS定义的列.

Yes, you can use columns defined with AS in the GROUP BY clause.

这篇关于MySQL的操作顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆