japanyim Posted May 17, 2007 Share Posted May 17, 2007 table1codeID1234table2memberID12345I want get the result is 5how can i do Link to comment Share on other sites More sharing options...
aalbetski Posted May 17, 2007 Share Posted May 17, 2007 this may work for you select * from table2 t2 where not exists (select * from table1 t1 where t1.codeId = t2.memberId) Link to comment Share on other sites More sharing options...
aspnetguy Posted May 17, 2007 Share Posted May 17, 2007 select memberID from table2 where memberID=5 sorry, I had too! Could you be more specific about the conditions and the results you want? Link to comment Share on other sites More sharing options...
japanyim Posted May 18, 2007 Author Share Posted May 18, 2007 this may work for youselect * from table2 t2 where not exists (select * from table1 t1 where t1.codeId = t2.memberId) SELECT * FROM courses A2WHERE EXISTS (SELECT * FROM registration A1WHERE A1.first_choice_code = '0')#1064 - You have an error in your SQL syntax near 'exists (select * from registration A1 Where A1.first_choice_code = '0') LIMIT 0,' at line 3 Link to comment Share on other sites More sharing options...
japanyim Posted May 18, 2007 Author Share Posted May 18, 2007 table1codeID(PK)1234table2memberID(PK) codeID1 12 13 24 25 3in table2 no member choice 4I want in the query can select result is 4how can i do?? Link to comment Share on other sites More sharing options...
japanyim Posted May 18, 2007 Author Share Posted May 18, 2007 select memberID from table2 where memberID=5 sorry, I had too! Could you be more specific about the conditions and the results you want? thanks you!!but I have more conditions 1.i don't know i have how many id2.and i need do the conparation Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.