Welcome Guest, Not a member yet? Register   Sign In
SQL Question
#2

[eluser]davidbehler[/eluser]
Code:
SELECT ustudent.name as student_name, uteacher.name as teacher_name FROM lessons left join users ustudent on lessons.student_id = ustudent.id left join users uteacher on lessons.teacher_id = uteacher.id

Something like that should work. You might have to adjust the column names as I don't know the layout of your users table.


Messages In This Thread
SQL Question - by El Forum - 07-25-2009, 03:13 AM
SQL Question - by El Forum - 07-25-2009, 03:39 AM
SQL Question - by El Forum - 07-25-2009, 04:13 AM
SQL Question - by El Forum - 07-25-2009, 04:22 AM
SQL Question - by El Forum - 07-25-2009, 04:29 AM
SQL Question - by El Forum - 07-25-2009, 04:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB