You could do something like (not tested) select distinct city, orderby from ( select city, 2 as orderby from table where city < foo_city union select city, 1 as orderby from table where city >= foo_city ) order by orderby, city
that would tack the prior cities onto the end On Mon, Jul 7, 2008 at 2:19 PM, Ian Skinner <[EMAIL PROTECTED]> wrote: > Rick Faircloth wrote: >> Thanks for the replies, Charlie and Brian... >> >> Actually, I should have been more clear. >> >> I've got this code working, which "re-selects" all of the >> selected citis: >> >> <cfoutput query="get_cities"> >> <cfif (isDefined("form.fieldnames") and isDefined("session.city") and >> session.city contains >> #city#) or session.city is #city#> >> <option value="#city#" selected>#city# - #num_cities#</option> >> <cfelse> >> <option value="#city#">#city# - #num_cities#</option> >> </cfif> >> </cfoutput> >> >> What I need now is to get the first selected item to display >> at the top of the list. >> >> Will that require javascript? jQuery, perhaps? >> >> Rick > You could, but if you are building the select in CF as above, just do > something to sort the query into the desired order with the selected > city first. How this could be done depends on how the data is > organized, but it is 'doable'. > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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-Talk/message.cfm/messageid:308683 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4