Re: Finding the records in one table that are not in another table

2004-07-10 Thread mos
Jeff, You need to use a Left Join which will join rows from the second table even if the rows from the second table does not exist, and returns NULL for all column for the second table.. You then use the Where clause to check for a particular Table2.field that should exist (like Id colum

Re: Finding the records in one table that are not in another table

2004-07-10 Thread Rory McKinley
Jeff Gannaway wrote: I have 2 tables - ProductsOLD and ProductsNEW. I need to find the records that are in the ProductsOLD table and are NOT in ProductsNEW (this will tell me which products have been discontinued). Here's some sample data: +==+ | ProductsOLD | +==+ + Ve

Finding the records in one table that are not in another table

2004-07-10 Thread Jeff Gannaway
I have 2 tables - ProductsOLD and ProductsNEW. I need to find the records that are in the ProductsOLD table and are NOT in ProductsNEW (this will tell me which products have been discontinued). Here's some sample data: +==+ | ProductsOLD | +==+ + Vendor | ID | +---

Re: Select from one table where ID not in another table - Solved

2003-09-02 Thread Martin Moss
--- Original Message - From: "Martin Moss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 10:47 PM Subject: Re: Select from one table where ID not in another table > I'm not sure if I've described the exact results I want v

Re: Select from one table where ID not in another table

2003-09-02 Thread Kelley Lingerfelt
> 5,8,x,y,z,u,v,w,t > > This Works ok, HOWEVER, if Table2 Has no Data, the query returns NO results. > What I want it to return is:- > 1,8,x,y,z,u,v,w,t > 2,8,x,y,z,u,v,w,t > 3,8,x,y,z,u,v,w,t > 4,8,x,y,z,u,v,w,t > 5,8,x,y,z,u,v,w,t > > any Takers? > > Regards >

Re: Select from one table where ID not in another table

2003-09-02 Thread Martin Moss
uot; <[EMAIL PROTECTED]> To: "Martin Moss" <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 10:27 PM Subject: RE: Select from one table where ID not in another table > Well, in order for that to work, you will need to do an explicit "JOIN" > somewhere or

Re: Select from one table where ID not in another table

2003-09-02 Thread Matt W
Moss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 3:54 PM Subject: Select from one table where ID not in another table > All, > > Am wondering if it's possible to do a query that does something like this:- > > SELECT table1.*

Re: Select from one table where ID not in another table

2003-09-02 Thread Kelley Lingerfelt
select t1.* from table1 t1 LEFT JOIN table2 t2 on t1.id=t2.id WHERE t2.id IS NULL you can print out table2 values if you want, but they will all be NULL.. provided that table2.id and table1.id are the matches you are trying to find. Kelley Martin Moss wrote: > All, > > Am wondering if it's p

Re: Select from one table where ID not in another table

2003-09-02 Thread Martin Moss
r otherkeyid I still want to get table1.* Regards Marty - Original Message - From: "Martin Moss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 9:49 PM Subject: Select from one table where ID not in another table > All, > &g

Re: Select from one table where ID not in another table

2003-09-02 Thread Martin Moss
r otherkeyid I still want to get table1.* Regards Marty - Original Message - From: "Martin Moss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 9:49 PM Subject: Select from one table where ID not in another table > All, > &g

RE: Select from one table where ID not in another table

2003-09-02 Thread Dathan Vance Pattishall
TECTED] -->Subject: Select from one table where ID not in another table --> -->All, --> -->Am wondering if it's possible to do a query that does something like -->this:- --> -->SELECT table1.*,table2.id from Table1 AS table1,Table2 AS table2 -->WHERE table1

Select from one table where ID not in another table

2003-09-02 Thread Martin Moss
All, Am wondering if it's possible to do a query that does something like this:- SELECT table1.*,table2.id from Table1 AS table1,Table2 AS table2 WHERE table1.id DOESN'T EXIST IN table2.id; Regards Marty --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://ww

Select from one table where ID not in another table

2003-09-02 Thread Martin Moss
All, Am wondering if it's possible to do a query that does something like this:- SELECT table1.*,table2.id from Table1 AS table1,Table2 AS table2 WHERE table1.id DOESN'T EXIST IN table2.id; Regards Marty --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.

Re: Not in Another Table

2002-01-08 Thread Dibo Chen
select a.* from a left join b on a.id = b.id where b.id is null; Ken Kinder wrote: > > Is there a way I can filter OUT records referenced in another table? > > With Subselects it would be this, but I'm using 3.23: > > select > a.* > from > a > where > a.id not in (select id from b) >

Not in Another Table

2002-01-08 Thread Ken Kinder
Is there a way I can filter OUT records referenced in another table? With Subselects it would be this, but I'm using 3.23: select a.* from a where a.id not in (select id from b) You get the idea. - Before posting, please