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!

Distinct query 1

Status
Not open for further replies.

jvande

MIS
Jun 6, 2001
115
US
Lets say I have a table with the following information

Date1 Date2 Date3
1/1/04 1/5/04 1/1/04
1/4/04 1/8/04
1/8/04 1/5/04 1/10/04

I want a query that will only return the unique dates of all these fields. So the result would be
1/1/04
1/4/04
1/5/04
1/8/04
 
Code:
select date1 from t
union
select date2 from t
union
select date3 from t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top