Re: What should be a simple table comparison...
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Mon, 17 Jul 2006 08:39:43 -0400
How about
SELECT tblFromXLS.*
FROM tblFromXLS LEFT JOIN tblWebMaster
ON tblfromXLS.SSN=tblwebmaster.SSN
WHERE tblwebMaster.SSN is Null
Your query does not reference the table tblWebMaster in the FROM clause of
the query. You could rewrite it to
SELECT * From tblFromXLS
WHERE SSN NOT IN
(SELECT SSN FROM tblWebMaster)
or to
SELECT * From tblFromXLS
WHERE Not Exists
(SELECT * FROM tblWebMaster
WHERE tblWebMaster.SSN = tblFromXLS.SSN)
<nintendomasta811@xxxxxxxxx> wrote in message
news:1153139066.291387.213830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello everyone,
I have a simple dilemma that I just can't seem to solve. I have two
tables: tblfromXLS and tblwebmaster. I need to use an SQL statement
that will check the variable SSN (used in both tables) in tblfromXLS
against the variable SSN in tblwebmaster. Basically, I need to
determine if a row's SSN in tblfromXLS has any matches in tblwebmaster
and if NOT then insert the row into tblwebmaster. This cannot be that
complicated, but I am running into problems. Currently I am using the
statement:
"SELECT * From tblFromXLS WHERE NOT EXISTS (SELECT * FROM tblfromXLS
WHERE tblfromXLS.SSN=tblwebmaster.SSN);". However, whenever I run the
statement I get an inputbox asking me for the value of tblwebmaster.SSN
(SQL is not detecting the value it seems). Thanks in advance.
.
- Follow-Ups:
- Re: What should be a simple table comparison...
- From: nintendomasta811
- Re: What should be a simple table comparison...
- References:
- What should be a simple table comparison...
- From: nintendomasta811
- What should be a simple table comparison...
- Prev by Date: What should be a simple table comparison...
- Next by Date: Re: Performing expression on all (varying number of) fields
- Previous by thread: What should be a simple table comparison...
- Next by thread: Re: What should be a simple table comparison...
- Index(es):
Relevant Pages
|
|