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
相關文章
相關標籤/搜索