Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT level, COUNT(id) AS jml
FROM soal
GROUP BY level;
SELECT
SUM(CASE WHEN level = 'mudah' THEN 1 ELSE 0 END) AS mudah,
SUM(CASE WHEN level = 'sedang' THEN 1 ELSE 0 END) AS sedang,
SUM(CASE WHEN level = 'sulit' THEN 1 ELSE 0 END) AS sulit
FROM soal;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment