Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-07-17 : 03:25:46
|
| here is the table structure table Auser_id user_name 1 harshal2 jay3 rajtable BProject_id Project_name ProjAdded_by ProjectLeader1 ProjA 1 2 2 projB 2 23 ProjC 1 3here in the table B ,columns projAdded_by and projectleader are the user_id from the table AI want the names of the person for each product in a single query ,the result should be like Projectname project_addedby projectleaderProjA harshal jayprojB jay jayprojC harshal rajIs this possible with a single query?regards,harshal.The Judgement of the Judge is as good as the Judge. |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2003-07-17 : 04:11:05
|
| Hi Harshal!select b.ProjectName,a1.user_name as project_addedby,a2.user_name as projectleaderfrom a a1,a a2,bwhere a1.user_id=b.ProjAdded_by anda2.user_id=b.ProjectLeader |
 |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-07-17 : 05:22:56
|
thanks a lot Andraax.i think i am growing dumb and dumb day by day! The Judgement of the Judge is as good as the Judge. |
 |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2003-07-17 : 07:29:32
|
I'm growing lazy... Not good either |
 |
|
|
|
|
|