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

Distinct values only 1

Status
Not open for further replies.

Pekka

Technical User
Mar 19, 2002
107
FI
Hi,
I have a following data forexample:

Tp Tp_k Se_1
A10 B10 1
A10 B10 2
A20 B11 2
A20 B10 1
A20 B12 1

I would like to have those Tp values that have nothing else than Tp_k = B10 rows. In my example I would only accept Tp=A10.

Pekka

"every dog will have his day
 
SELECT DISTINCT Tp
FROM pekkatable
WHERE Tp NOT IN
(SELECT Tp FROM pekkatable
WHERE Tp_k <> 'B10')


Kippis!
 
Thanks, jag tackar och pockar.
Skål!

Pekka

"every dog will have his day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top