SQL step on pit notes

  1. Sql execution order of: From -> Where -> Group By -> Having -> Select -> Order By
  2. Group By clause can not use the Select clause alias (because of the execution order)
  3. Select clause, Having clause, Order By clause can use Count (*) like aggregate functions
  4. Where clause is used to specify the data line condition, Having clause specifies grouping criteria
  5. Having clause components: constant, aggregate functions, Group By column name specified in clause (i.e., polymerization key)
  6. In the polymerization using the functions: the Select clause have strict requirements: constants specified, aggregate functions, Group By clause column name (i.e., polymerization key)
  7. Ways to create a view: CREAT VIEW view name (<1 view column name>, <View column name 2>, ......) AS <Select statement>
  8. Order By clause can not use the view is defined
  9. updating. . . .

     ~ Do not like basketball photographers is not a good programmer -

Published 17 original articles · 87 won praise · views 50000 +

Guess you like

Origin blog.csdn.net/gaojiajie333/article/details/79353598