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 ... Quote Link to comment 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),'-')) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.