I have select table like this
SELECT COUNT(id_lokasi) AS terbanyak, id_lokasi
FROM personil_tunas_paragitas
GROUP BY id_lokasi ORDER BY terbanyak DESC LIMIT 1
then i want to select the id_lokasi
SELECT id_lokasi
FROM (SELECT COUNT(id_lokasi) AS terbanyak, id_lokasi
FROM personil_tunas_paragitas GROUP BY id_lokasi ORDER BY terbanyak DESC LIMIT 1);
but this query give me error. am i have something wrong with this query?