Click to See Complete Forum and Search --> : A little too crazy for me


spuppett
June 1st, 2005, 12:11 PM
I have a query that I need to execute, only I don't know how.

What I have done so far is to extract the data I want from one table and put it into another, no big deal. What I need to do now is select everything in the orig. table that isn't in the new table.

I was thinking something along the lines of Select * FROM tbl1 WHERE NOT IN (SELECT * FROM newTbl)
That doesn't work, though I've seen similar select statements before. I would prefere to avoid simply reversing my logic from the original select statement if at all possible.

Any one have any thoughts?

P.S. Using Visual Fox Pro

Shuja Ali
June 1st, 2005, 12:18 PM
Not sure about foxpro.. but won't this work:


Select * From tbl1 Where tbl1'sForeingKeyField Not In (Select PRIMARYKEYFIELD From newTbl)

spuppett
June 1st, 2005, 02:40 PM
That might be crazy enought to work. Thanks