Re: SQL question

From: Graham Farquharson <graham_at_tecskor.com>
Date: 1998/01/14
Message-ID: <34bd1f4e.0_at_news.cadvision.com>#1/1


Hi Miguel
This might work. I kind of doubt it actually. It does work on your little test set but the logic have a suspicion that it only works because the set is so simple. Give it a whirl though. If it doesn't work maybe you will get some ideas from this at least.

select a,b from test
where a not in
 (select a from test t1 where not exists

    (select 1 from test where t1.a <> a and t1.b = b)   )
GOOD LUCK!

--
Graham Farquharson
Tecskor Software Inc
graham_at_tecskor.com
miguel wrote in message <01bd2030$3d6218c0$0a0a2c0a_at_jmiguel.cet.pt>...

>Hi,
>
>Table TEST (A,B)
>
>A B
>1 10
>1 11
>1 12
>2 10
>2 11
>2 13
>3 10
>3 11
>3 12
>4 8
>4 11
>4 14
>How can i obtain the records that have the same value B group by A. For
>example i want a query to return:
>A B
>1 10
>1 11
>1 12
>3 10
>3 11
>3 12
>
>Thanks
>Miguel
>
Received on Wed Jan 14 1998 - 00:00:00 CET

Original text of this message