Hello i try to run this query but this error come up
#1241 - Operand should contain 1 column(s)
here is the code :
SELECT
(SELECT kk.namakk, anggkk.nama AS istri
FROM kk
JOIN anggkk
USING ( idkk )
WHERE anggkk.hubungan = "istri"),
(SELECT anggkk.nama AS anak, YEAR( CURDATE( ) ) - YEAR( anggkk.ttl ) AS usia_anak
FROM anggkk
JOIN kk
USING ( idkk )
WHERE anggkk.hubungan = "anak")
FROM kk, anggkk
GROUP BY kk.idkk
where is my error? thanks for the help!
Operand should contain 1 column(s)
, means you have many columns returned in your subqueries.you need to add limit 1 to be just one column like that
or you have to be more specified on what you selecting to be one column