Pichan, Thursday, March 14, 2002, 6:19:23 AM, you wrote: PM> I have 2 tables, let says, table A and table B. Each table record person PM> name.
PM> select B.name from B, A where B.name = A.name PM> Query above should return the name which recorded in both tables (duplicate PM> name) PM> In reverse, how can I retrive the name which recorded in Table B and not PM> present in Table A? PM> Table A PM> name id PM> ---------------------------------------- PM> Johnson | 1203 PM> Jack | 1192 PM> Mary | 5509 PM> Jimmy | 1189 PM> ---------------------------------------- PM> Table B PM> name level PM> ---------------------------------------- PM> Johnson | AA PM> Mary | AC PM> Alex | AA PM> Chris | AA PM> ---------------------------------------- PM> select B.name from B, A where B.name <> A.name PM> this query not work as I expect, also with join SELECT B.name from B LEFT JOIN A ON B.name=A.name where A.name IS NULL; You can find info about JOIN clause at: http://www.mysql.com/doc/J/O/JOIN.html -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php