[thelist] Weird SELECT DISTINCT error

Brian Cummiskey Brian at hondaswap.com
Thu Dec 15 22:45:40 CST 2005


Matt Warden wrote:

> Actually, you are selecting unique combinations of opp_id and
> policy_name. If you think about it, since results are returned in rows,
> it is difficult to see how DISTINCT could operate on only one column.

I ran a sample query on a table before I posted this.

table is set up like:

id	name
1	bob
2	jane
3	mary


I threw some non-unique ID numbers in, and ran the query.

In mssql 2000, it pulled the unique ID's only, and the first name with 
such record for the query of SELECT distinct id, name.

Unless my sql is server is different???






More information about the thelist mailing list