If you're doing a distinct select on another field, the id is mostly useless. However, if you group or sort the results, you could do something like get the min or max id for each distinct record. I can't think of any reason why you would want to, but it's possible.
On Tue, Sep 23, 2008 at 12:13 PM, Charlie Griefer <[EMAIL PROTECTED]> wrote: > curious tho... if each rgcompany has a unique ID (which it seems to have), > which rg_id value would be returned with that recordset? a random one? if > you need the rg_id... then wouldn't it be a "bad thing" to just grab a > random one? > > On Tue, Sep 23, 2008 at 12:07 PM, Loathe <[EMAIL PROTECTED]> wrote: > >> Oh thats good to know, could have used that last week. >> >> Casey Dougall wrote: >> > On Tue, Sep 23, 2008 at 1:56 PM, Erika L. Walker <[EMAIL PROTECTED] >> >wrote: >> > >> >> yups - just figured that one out. >> >> >> >> /me smacks self in head ... >> >> >> > >> > >> > But you can still get that ID and other junk at the same time with () >> around >> > your column. >> > >> > select DISTINCT(RGCOMPANY), RG_ID >> > from REGISTRATION >> > order by RGCOMPANY >> > >> > >> > >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:270595 Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
