aswini_1978 Posted December 7, 2006 Share Posted December 7, 2006 Can anyone help me out !!!!I am currently using this query which is working fineSELECT pid, name_last FROM TabA where pid Not In(select pid from TabB where encounter_class_nr=1 and is_discharged=0 ) order by date_reg descBut its not working in MySQL 4.1 as subquery is not supportedSo I want to solve this by join query...Anyone can replyThanx a ton in advance Link to comment https://forums.phpfreaks.com/topic/29773-join-query/ Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 [code]SELECT pid, name_lastFROM TabALEFT JOIN TabB ON TabA.pid = TabB.pid AND TabB.encounter_class_nr=1 AND TabB.is_discharged = 0WHERE TabB.pid IS NULL[/code] Link to comment https://forums.phpfreaks.com/topic/29773-join-query/#findComment-136734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.