How do I select a list of DUPLICATE values from field F of table T?
F can be equal NULL as well.
Thanks.
PS: MSSQL 2000
SQL вопросик...
-
- Ник удалён за неоплаченную рекламу
- Posts: 391
- Joined: 15 May 2002 09:16
- Location: было оттуда, теперь отсюда
-
- Уже с Приветом
- Posts: 8249
- Joined: 23 Jul 2003 03:53
- Location: SPb - KW - NY - CT - MD
Re: SQL вопросик...
alkapin wrote:How do I select a list of DUPLICATE values from field F of table T?
F can be equal NULL as well.
select F
from (select F, count(*) as S from T group by F) as X
where S > 1;
или
select F, count(*)
from T
group by F
having count(*) > 1;
P.S. Не понял, какая роль NULL для F?
LG - Life's good.
But good life is much better.
But good life is much better.
-
- Уже с Приветом
- Posts: 15312
- Joined: 30 Apr 2003 16:43
-
- Ник удалён за неоплаченную рекламу
- Posts: 391
- Joined: 15 May 2002 09:16
- Location: было оттуда, теперь отсюда