SQL:Joining same table more than once

From: Cathy Fischer <cfischer_at_beach.utmb.edu>
Date: 1995/12/07
Message-ID: <4a7idb$72a_at_atlantis.utmb.edu>#1/1


Isn't it possible to join the same table in the query more than once using different aliases? Here is what I am trying to do:

	select e.id, e.code1, a.description, e.code2, b.description,
	       e.code3, c.description
	from emp e, code_table a, code_table b, code_table c 
	where e.id = 123
	and a.code = e.code1
        and (b.code = e.code2 or e.code2 is null)
	and (c.code = e.code3 or e.code3 is null);

I thought I could do this but it is not working properly at all.

Please send replies to cfischer_at_beach.utmb.edu Received on Thu Dec 07 1995 - 00:00:00 CET

Original text of this message