Re: syntax of select for a left join
Posted in 1998
Jun Yan wrote: > > Hi, can someone tell me the correct syntax for a left join? A LEFT join? > What I have is: > Table 1: > people's name|...|office building code|... > > Table 2: > building code | full name of buildings > > What I want is a list of all people with full building name, if someone > does not have an office, I still want it, just leave the building's name > blank. Argh, okay. I guess the right way to do a left join would be to use an outer join: SELECT people's name, full name of buildings FROM Table 1, OUTER Table 2 WHERE office building code = building code Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com http://www.informix.com/idn |///// / //| |http://www.iiug.org +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+