Fetch and match data from 2 tables?
#2
(2015-06-11, 02:57 PM)marcus123 Wrote: 2 tables A and B
[...]
column A [...] column B?
Trying to treat tables as columns may be your problem...

Assuming you meant 'table' throughout, there may be a few ways to write the SQL. Perhaps the most obvious is a correlated query:
SELECT tid FROM A WHERE tid NOT IN (SELECT tid FROM B)

If the tid columns are unique, a join could also work:
SELECT A.tid FROM A
LEFT JOIN B ON A.tid=B.tid
WHERE B.tid IS NULL
Reply


Messages In This Thread
RE: Fetch and match data from 2 tables? - by Yumi - 2015-06-12, 05:31 AM
RE: Fetch and match data from 2 tables? - by Yumi - 2015-06-13, 10:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)