Welcome Guest, Not a member yet? Register   Sign In
Complex join statement
#2

[eluser]tchule[/eluser]
Hello,

I think you have to join the user table twice, one time for the recipient and one time for the author.

Something like this (approximate syntaxe) :

Code:
SELECT *
FROM messages m
JOIN users u1 having (u1.userid = m.authorid)
JOIN users u2 having (u2.userid = m.recipientid)

Tchule


Messages In This Thread
Complex join statement - by El Forum - 06-08-2008, 01:27 PM
Complex join statement - by El Forum - 06-09-2008, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB