謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Wednesday, February 13, 2013
[MYSQL] 分組 "GROUP BY"
列出不重覆的欄位值
SELECT * FROM mytable GROUP BY kind
搭配SUM()可以計算分組之後的總和
SELECT SUM(money) FROM mytable GROUP BY kind
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment