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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do sql statement with except 1

Status
Not open for further replies.

inarobis

IS-IT--Management
Joined
Apr 3, 2006
Messages
71
Location
CH
Hello all,


I would like to have all the elements belong to this record
= 'Geo' but not the element = 'USA;

Any idea?

Ina

This is my query
================
select distinct record.element as element
from record where record.Type = 'Geo'
except
(select record.element as element
from record
where record.element = 'USA');
 
Code:
select distinct record.element as element
from record
where record.Type =  'Geo'
and record.element <> 'USA'

If I read your question right!

Rgds,

M.
 
Thanks a lot! I was stuck in this except and I did not see like that. Simple

Ina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top