DISTINCT works across all the columns, so if first names are different
you'll get two rows back for a given atty_id.

Adrian

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: 14 May 2008 18:57
To: CF-Talk
Subject: Distinct on just ONE column in a CFQUERY


The below is querying a SQL Server VIEW.
I'm trying to return distinct atty_id, but I'm still getting some
records returned multiple times.


SELECT DISTINCT(atty_id),
        first_name,
        last_name,
        COALESCE(atty_rank, 9999) as atty_rank
FROM get_attypa
WHERE isACTIVE = 'y'
ORDER BY atty_rank, last_name, first_name



ATTY - (Main Table)
--------------
atty.atty_id
atty.first_name
atty.last_name

RANK
--------------
rank.atty_id (tied to atty.atty_id, but marked NOT to display)
rank.atty_rank



Ideas?

Is there a way to define this in the VIEW instead of in the CFQUERY tag?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305263
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to