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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Statement -- Help

Status
Not open for further replies.

giahan

Programmer
Sep 1, 2000
139
US
Hi all,

I have a table like this

Origin_No Origin_Name Destination_No Destination_Name
---------- ----------- -------------- ----------------
1007 name7 1002 name2
1008 name8 1008 name8
1011 name11 1007 name7
1012 name12 1115 nam15
..
..
..
..

I have to create a list as
Code Name
------- -------
1002 name2
1007 name7
1008 name8
1011 name11
1012 name12
1115 name15

Is there any way to do a report like? Any thought?
Thanks in advance.

GH
 
Try a UNION query.

Select Origin_No As
Code:
, Origin_Name As [Name]
  From Table
Union
Select Destination_No, Destination_Name
  From Table
Order By [Code] Terry
[URL unfurl="true"]http://members.home.net/tlbroadbent/sqlarticles.htm[/URL]
[COLOR=maroon]
"I'm not dumb. I just have a command of thoroughly useless information." - Calvin, of Calvin and Hobbes[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top