Reputation: 45
I have a mysql table with this :
In table 1, i have 3 column : Bidang, Keahlian, Nilai. In table result in the coloumn saran i want to combine keahlian based on bidang, but keahlian taken if nilai > 0. The result like this :
So, please help me to make this.
Upvotes: 0
Views: 105
Reputation: 1025
You can user bewlow query
SELECT bidang,GROUP_CONCAT(kealian) as saran
FROM table1
WHERE nilai>=0
GROUP BY bidang
Upvotes: 0
Reputation: 6134
like this:
SELECT Bidang,GROUP_CONCAT(Keahlian SEPARATOR ',') As Saran
FROM Table_1
WHERE Nilai>0
GROUP BY Bidang
Upvotes: 1
Reputation: 18600
Try this
SELECT Bidang,GROUP_CONCAT(Keahlian SEPARATOR ',')
FROM table_1
WHERE Nilai>0
GROUP BY Bidang
Upvotes: 1