GOKU Posted May 19, 2008 Share Posted May 19, 2008 Can iffnull with subquery ? Example select a.id,a.nama,(select nama_file from mr_foto x where x.id_property=a.id and utama=1 and hide_member=0),a.jenis,a.alamat, concat(b.nama,', ',c.nama),harga,(ifnull(select x.nilai from tr_spek_property x where x.id_property=a.id and x.id_spek=4,'-')) from mr_property a,mr_kota b,mr_propinsi c occurs error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select x.nilai from tr_spek_property x where x.id_property=a.id and x.id_spek=4,' at line 2 What the correct sql? Thank you ... Link to comment https://forums.phpfreaks.com/topic/106274-about-ifnull-function/ Share on other sites More sharing options...
fenway Posted May 19, 2008 Share Posted May 19, 2008 You need to wrap your subquery in parens: (ifnull((select x.nilai from tr_spek_property x where x.id_property=a.id and x.id_spek=4),'-')) Link to comment https://forums.phpfreaks.com/topic/106274-about-ifnull-function/#findComment-544736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.