![](/img/trans.png)
[英]How do I read in an input file with a scanner or buffered reader and count all the occurences of a specific character in the input file
[英]count the no of specific values occurences in a specific column sql
通過執行COUNT(DISTINCT ATTENDANCE),您正在計算STU_ID列中的不同值。 有幾個,兩個? 只是“當前”和“不存在”?
嘗試:
SELECT COUNT(*) AS AttendanceCount
FROM STUDENT
WHERE STU_ID = 40
AND ATTENDANCE = 'PRESENT'
或者,如果您想見每個學生,
SELECT STU_ID, COUNT(*) AS AttendanceCount
FROM STUDENT
WHERE ATTENDANCE = 'PRESENT'
GROUP BY STU_ID
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.