mysql query : How to join multiple table with statment
I have mysql query below. but it not work.
Select CASE
WHEN isLevel = '1' THEN 'Mahasiswa'
WHEN isLevel = '2' THEN 'Dosen'
WHEN isLevel = '3' THEN 'Karyawan'
ELSE 'Admin'
END as level from mhs left join if(isLevel=1,'mahasiswa','dosen') on
username=iduser where blabala.
if "isLevel=1" join with mahasiswa table and if "isLevel=2" join dosen
table,.. How to the query?
please help me. thanks.
No comments:
Post a Comment