If you don't care about the case where first and last names differ, I'm not
sure why you're including them in the query, but you can try this:
SELECT atty_id,
MAX(first_name) AS first_name,
MAX(last_name) AS last_name,
MIN(COALESCE(atty_rank, 9999)) AS atty_rank
FROM get_attypa
WHERE isACTIVE = 'y'
GROUP BY atty_id
ORDER BY atty_rank, last_name, first_name
On Wed, May 14, 2008 at 3:52 PM, Dave Watts <[EMAIL PROTECTED]> wrote:
> > > DISTINCT works across all the columns, so if first names
> > > are different you'll get two rows back for a given atty_id.
> >
> > OK - how to force only *one* unique ID per returned results?
>
> You can't. How would it show the additional results?
>
> You can, however, use the GROUP attribute of the CFOUTPUT tag so that you
> don't show the ID multiple times.
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
>
> Fig Leaf Training: Adobe/Google/Paperthin Certified Partners
> http://training.figleaf.com/
>
> WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers!
> http://www.webmaniacsconference.com/
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:305275
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4