Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query to get duplicate ntext

Author  Topic 

Andy dg
Starting Member

6 Posts

Posted - 2007-03-02 : 17:21:26
I have records in a table as :

Col1 Col2 Col3 Col4

11 15090 12 2084511
11 19610 12 2084511

How do I query to get records where count(Col4) >1 and Col3 =12
Please note that Col4 is ntext datatype.

TIA,
Andy

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-02 : 17:42:25
When you say the count of Col4, do you mean the number of non null values in Col4?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-02 : 17:44:38
select col4
from table1
where col3 = 12
group by col4
having count(*) > 1


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -