TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anil Thakur
604
1.8k
1.2m
How to get MemberId, MemberName,FriendId and FriendName?
Nov 7 2016 1:11 AM
How i can get from these tables the list of Member and his friend name and friend id?
I need the four column output-:
1) MemberId
2) MemberName,
3) FriendId
4) FriendName
create
table
#
temp
(Memberid
int
,
Name
varchar
(500))
Insert
into
#
temp
(Memberid,
Name
)
values
(1,
'Anil Thakur'
)
Insert
into
#
temp
(Memberid,
Name
)
values
(2,
'Ankit'
)
Insert
into
#
temp
(Memberid,
Name
)
values
(3,
'Sonia'
)
Insert
into
#
temp
(Memberid,
Name
)
values
(4,
'Airi'
)
Create
table
#temp1(id
int
,SenderIdId
int
,ReceiverId
int
, status
varchar
(2))
insert
into
#temp1(id,SenderIdId,ReceiverId,status)
values
(1,1,2,
'A'
)
insert
into
#temp1(id,SenderIdId,ReceiverId,status)
values
(2,2,4,
'A'
)
insert
into
#temp1(id,SenderIdId,ReceiverId,status)
values
(3,3,1,
'A'
)
insert
into
#temp1(id,SenderIdId,ReceiverId,status)
values
(4,4,1,
'A'
)
insert
into
#temp1(id,SenderIdId,ReceiverId,status)
values
(4,4,2,
'A'
)
Reply
Answers (
1
)
update data base
SQL - Updating the hours from the Previous Records