Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help!!! preventing duplicates when populating a dropdown box.

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
when i add in "Distinct" to

check= "SELECT Leaving, Destination, arrTime, depTime FROM Holidays"

it groups all the same occurences together.

ie. before i added it in i got:
london
edinbouragh
london
london
edinbouragh

when distinct is added i get:
london
london
london
edinbouragh
edinbouragh

any suggestions??
 
If you want only one column from your table then Select only one, like this:
SELECT DISTINCT Leaving FROM Holidays
otherwise you may consider to take a look at the GROUP BY clause and the Agregate functions.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top