Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query problems

Status
Not open for further replies.

tinoco

IS-IT--Management
Feb 16, 2005
49
ES
hi!
i have two lists, one with members phone numbers and the other with lots of phone numbers.
I want to make a query that retrieves me all the numbers in the second list that are not equal to the ones in the first list.

how can i do it?

thanks a lot
 
select number from listtwo where
number not in (select number from listone)

-DNG
 
hi!
this is the SQL code in my query..

SELECT externos.[NR LLAMADO], tlf_emp.telefonos
FROM externos INNER JOIN tlf_emp ON externos.NOMBRE = tlf_emp.nombres
Where externos.[NR LLAMADO] not in tlf_emp.telefonos;
this retrieves me an error!!

externos.nrllamado is the table field with all the numbers,
tlf_emp.telefonos is the table field with just a few numbers.

i want all the numbers in "externos.nrllamado" that are different from the ones in "tlf_emp.telefonos"
i'm using Access 2003

i really don't know how to do it!
thanks a lot

 
like this:

SELECT [NR LLAMADO]
FROM externos
Where externos.[NR LLAMADO] not in (Select telefonos FROM tlb_emp);

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Another way:
SELECT externos.*
FROM externos LEFT JOIN tlf_emp ON externos.NOMBRE = tlf_emp.nombres
WHERE tlf_emp.nombres Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top