Chris,
Thanks for the suggestion. I didn't know about UNION (I'm new to all of
this), but unfortunately it didn't work for my purpose. I need for the
first and second SELECT statements to have ORDER BY clauses, and UNION
doesn't allow this. It seems to only want you to sort once you've
completely assembled the data to be returned.
The workaround that I have is probably fine. At this point, I leave this
question hanging out here only out of curiosity.
Thanks,
Matthieu
> -----Original Message-----
> From: Christopher Olive, CIO [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 28, 2000 1:33 PM
> To: CF-Talk
> Subject: RE: SQL Dropdown List
>
>
> your best bet is to do a union
>
> ex:
>
> SELECT
> blahblah <this is your USA query>
> FROM
> cities
> WHERE
> country = USA
> UNION
> SELECT
> blahblah <your Non-us cities>
> FROM
> cities
> WHERE
> country <> USA
>
> try that.
>
> a UNION "stacks" the queries on top of one another.
>
> chris olive, cio
> cresco technologies
> [EMAIL PROTECTED]
> http://www.crescotech.com
>
>
>
> -----Original Message-----
> From: Cornillon, Matthieu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 28, 2000 1:20 PM
> To: CF-Talk
> Subject: SQL Dropdown List
>
>
> Hi. I have a dropdown list that lets users pick a country
> from a list of
> company locations stored in a database. Possible entries are France
> (Paris), England (London), etc. It all works fine. However,
> my supervisor
> wants the USA (Cityname) entries to appear at the top of the
> list, since
> they are the most common. I created this list using two separate SQL
> queries, which I then used to generate the dropdown list. Is
> there a way to
> do this sort using just a single SQL statement, so that I do
> not have to
> juggle two queries?
>
> For example, the list should look like this in the dropdown:
>
> USA (Albequerque)
> USA (Boston)
> USA (Chicago)
> Argentina (Buenos Aires)
> Bolivia (La Paz)
> Canada (Toronto)
> etc.
>
>
> Any ideas?
>
> Thanks,
> Matthieu
>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server! Instant Activation for $99/month w/Free
Setup from SoloServer PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support
Visit SoloServer, https://secure.irides.com/clientsetup.cfm.
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists