How can I make this sql section

In my table tblAttendeeMaster I have data like as below
AttendeeID FirstName Familyleadid
530 Anu 0
531 Manu 530
532 Ramu 0
533 Jeevan 532

How can I write a sql query to select to display as follows
AttendeeID FirstName Familyleadid
530 Anu
531 Manu Anu
532 Ramu
533 Jeevan Ramu

Hi anupalavila,

pls try my solution:

SELECT a.AttendeeID, a.FirstName, b.FirstName AS Familyleadid
FROM dbo.tblAttendeeMaster a
 LEFT JOIN dbo.tblAttendeeMaster b ON b.AttendeeID = a.Familyleadid

MCSA: SQL 2016 Database Development
MCSE: Data Management and Analytics

Tested by: