Groups | Blog | Home
all groups > sql server (alternate) > march 2005 >

sql server (alternate) : curious result


David Portas
3/7/2005 9:28:02 AM
Your question is a bit vague but maybe this example will help.
Duplicate last names in the Aithors table:

SELECT au_lname, COUNT(*)
FROM Pubs.dbo.Authors
GROUP BY au_lname
HAVING COUNT(*)>1

If you need more help please read the following article about the best
way to post your problem.

http://www.aspfaq.com/etiquette.asp?id=5006

--
David Portas
SQL Server MVP
--
William Kossack
3/7/2005 10:19:17 AM
William Kossack
3/7/2005 2:21:40 PM
this works except I'm needing distinct combinations of several fields
such as

SELECT x, y, z, COUNT(*)
FROM table
GROUP BY x
HAVING COUNT(*)>1

[quoted text, click to view]
Erland Sommarskog
3/7/2005 11:40:34 PM
William Kossack (kossackw@njc.org) writes:
[quoted text, click to view]

And that query is good for you? Or are you asking for more assistance?
In the latter case, please post:

o CREATE TABLE statment for the your table
o INSERT statement with sample data.
o The desired result given the sample.

if we have to guess what you are looking for, odds are that our
guesses will be wrong.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
AddThis Social Bookmark Button