I have Message table in which “senderid” and “receiverid”exists.
I have User table in which username of each user is found.
Now I want to make a stored procedure in which I select the username where userid=senderid and username in which userid=receivername.
I tried this but it’s wrong, coz I never made something like this before.
SELECT SystemUser.SU_Username Where SystemUser.SU_ID=MessageReciever As RecieverName, SystemUser.SU_Username where Message.SenderID = SystemUser.SU_ID As SenderName FROM Message CROSS JOIN
SystemUser
Is there a method to do what I want?
Select from the SystemUser table twice, with table aliases: