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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 trying to self join a table twice

Author  Topic 

marcusstar10
Starting Member

14 Posts

Posted - 2011-03-09 : 11:48:20
how do I complete this please

select p1.name || ' Name of Father and Mother ' || p2.name as "Father" || p3.name as "Mother"
from people p1
inner join people p2
on p1.father_id=p2.person_id
inner join people p3
on p1.mother_id=p3.person_id;

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-03-09 : 11:59:08
what are you trying to achieve? can you explain with the help of some sample data of the people table and required output for that data ?

Cheers
MIK
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-03-09 : 12:05:10
is this T-SQL? || is not concatenation operator in T-SQL

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -