select distinct state
from locations

On 12/30/06, Gary Strommen <[EMAIL PROTECTED]> wrote:
>
> Hopefully this is an easy question...
>
> I have a database that has location of buildings.  In this table, it has
> the State, City, and Building Name.  I am creating a query to return the
> State values for the user to select from.  Obviously there are multiple
> values for each state but I only want the state option to appear once (not
> once for every building in that state).  I.E.  I want it to give
>
> California,
> Nevada,
> Ohio,
> etc.
>
> NOT
>
> California,
> California,
> California,
> Nevada
> Nevada
> etc.
>
> Here is my code:
>
> <cfquery name="qGetLocations" datasource="mydatasource">
>         SELECT primaryKey, State
>         FROM Locations
> </cfquery>
>
> What should I add to the above code so that it does not bring back
> duplicate values?
> Thanks!
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2389
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to