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.
Author |
Topic |
utleya
Starting Member
3 Posts |
Posted - 2002-08-28 : 14:25:26
|
Hi all, I have a table that I need to queryto show only duplicate DocNums and an associated fieldcalled DocType.Example of desired output:DocNum DocType-------- ----------92-155 TOP92-155 ROP92-155 HOR02-999 TOP02-999 ROPThe following was suggested on another site, but will notwork with SQL Server:SELECT DocNum, DocTypeFROM leDocsWHERE (docnum, doctype) IN (SELECT docnum, doctype FROM ledocs GROUP BY docnum, doctype HAVING COUNT(*) > 1)ORDER BY docnum, doctypeAny help will be appreciated, thanks, Andy |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-08-28 : 14:37:20
|
Andy,Unlike some other boards, we at SQLTeam prefer you to just post your question in one category because the top answer people review all categories and it will get seen just as quickly regardless of which category it's in.All answers should be posted to this thread: [url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=19267[/url] |
 |
|
|
|
|