成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

thinkphp mysql 查詢

瀏覽:106日期:2022-06-15 18:53:35

問題描述

有一個(gè)數(shù)據(jù)表,如圖thinkphp mysql 查詢

我想查user_login一共有多少種,比如這個(gè)圖里一共是4種,怎么在一條查詢語句中查詢?用count(user_login)會(huì)查出總數(shù)。求大神指導(dǎo)

問題解答

回答1:

select count(id) as rows from table group by user_login;

回答2:

GROUP BY user_login

回答3:

試試這個(gè) count(’distinct(user_login)’)

回答4:

建議將表、數(shù)據(jù)的sql貼出來!

回答5:

thinkphp

$count = M(’TableName’)->group(’user_login’)->count(’*’);

相關(guān)文章: