उपयोग करें:
SELECT COUNT(*) AS total,
SUM(CASE
WHEN DATEPART(WEEKDAY, t.start_date) IN (2,6) THEN 1
ELSE 0
END) AS weekday
FROM ATTEND t
WHERE t.empl_no = 12345
उपयोग करें:
SELECT COUNT(*) AS total,
SUM(CASE
WHEN DATEPART(WEEKDAY, t.start_date) IN (2,6) THEN 1
ELSE 0
END) AS weekday
FROM ATTEND t
WHERE t.empl_no = 12345