mysql

  • as不是給表裏的字段取別名,而是給查詢的結果字段取別名。其目的是讓查詢的結果展現更符合人們觀看習慣,在多張表查詢的時候可以直接的區別多張表的同名的字段。
  • where 行級過濾 group by分組說明(僅在按組計算聚集時使用) having組級過濾
  • a left join b 等價於 b right join a
  • if you use an aggregate function or GROUP BY clause, the only things that can appear in
    your SELECT clause are the aggregate function(s) and the columns named in the GROUP
    BY clause.Also, if you want to use a column in a GROUP BY clause, it must be listed in the
    SELECT clause.
  • Note that the HAVING clause applies to the groups
  • Note that row numbers are zero indexed; that is, the first row
    in the output is row number zero.
  • Concat()連接多個字段,select Concat(name,’(‘,num,’)’)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章