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

Please help with SELECT command

Status
Not open for further replies.

Xkarlos77

Programmer
Jan 19, 2003
28
CZ
I have two tables

MAIN:
ID, ID_NAME1, ID_NAME2
1, 1, 2
2, 3, 4
2, 2, 1

and

NAME :
ID, Name, ....
1, Carlos
2, Novak
3, Jane
4, Andre


is there a way how select with one SQL command anything like this ???

Carlos, Novak
Jane, Andre
Novak, Carlos

thank you for your help
 
select concat(f.name,', '),l.name from
name as f inner join main on f.id = main.id_name1
inner join name as l on main.id_name2 = l.id
 
Thank you,

it works fine, can i Find anywhere find any TUTORIAL ???
i think its hard to understand this problem.

thanks


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top