0
我的表結構是一個表獲取數據:需要從其中包含與不同類別的唯一ID在MySQL
artist_id類別
1宋
1宋
1宋
1 Video
1 Vi DEO
現在,我的輸出必須
ID類總
1歌曲3
1視頻2
如何這可以通過使用MYSQL完成。
我的表結構是一個表獲取數據:需要從其中包含與不同類別的唯一ID在MySQL
artist_id類別
1宋
1宋
1宋
1 Video
1 Vi DEO
現在,我的輸出必須
ID類總
1歌曲3
1視頻2
如何這可以通過使用MYSQL完成。
我認爲這應該工作(未經測試):
select artist_id, category, count(*) as total from table group by artist_id, category
感謝伯爾尼..它的工作.. – Fero 2009-08-24 06:56:14
高興能幫上忙 – bernhardrusch 2009-08-24 08:08:56