MySQL语句执行顺序

1.select a,b,c from table where x = 1;  ==》》 where条件的 变量x 必须在表中存在;where是针对表作操做。 2.select a, b, c AS x having x = 1; ==》》 having 后的变量 x 能够是表中的列,也能够是别名,having是对查询结果集进行再筛选。这点区别于where,若是where使用别名,则会报"unkn
相关文章
相关标签/搜索