當前位置:首頁 » 編程語言 » sqldeclarevarchar

sqldeclarevarchar

發布時間: 2025-05-09 15:15:27

sql語句統計數量,統計一個欄位的值的數量

select type,count(*) as 總數量,
sum(case when level='一級' then 1 else 0 end) as 一級,
sum(case when level='二級' then 1 else 0 end) as 二級,
sum(case when level='三級' then 1 else 0 end) as 三級
from table group by type

樓上的應該改改吧

熱點內容
超級訪問沈傲君 發布:2025-07-10 17:06:33 瀏覽:692
安卓的手機來電閃光燈在哪裡 發布:2025-07-10 16:49:02 瀏覽:836
androidstudio導入as項目 發布:2025-07-10 16:43:37 瀏覽:538
c語言中編譯和編輯的差別 發布:2025-07-10 16:43:35 瀏覽:486
iphone清除緩存軟體 發布:2025-07-10 16:20:03 瀏覽:680
以下所列的c語言常量中錯誤的是 發布:2025-07-10 16:19:00 瀏覽:852
怎麼給安卓應用重命名 發布:2025-07-10 16:18:01 瀏覽:1001
php調用棧 發布:2025-07-10 15:58:33 瀏覽:870
android頁面返回 發布:2025-07-10 15:58:22 瀏覽:464
php解析多層json 發布:2025-07-10 15:51:36 瀏覽:874