KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When I do a left outer join, I expect to get all the records that the query would return prior to adding the joined table, but it is only returning records that match the joined table (i.e: no record for '092387' exists in table 'documentation', so I just want null returned for 'filename' field for that record.) What am I doing wrong? mysql> select documentation_reference.ref_docnumber , documentation.filename from documentation_reference left outer join documentation on ref_docnumber=documentation.docnumber where documentation_reference.docnumber='TP-036' and documentation.status!=3; +---------------+-----------------+ | ref_docnumber | filename | +---------------+-----------------+ | SOP-0042 | SOP-0042r39.pdf | +---------------+-----------------+ 1 row in set (0.00 sec) mysql> select ref_docnumber from documentation_reference where documentation_reference.docnumber='TP-036'; +----------------------+ | ref_docnumber | +----------------------+ | 092387 | | 1100218B | | Applicable Item Spec | | SOP-0042 | +----------------------+ 4 rows in set (0.00 sec)
Tags (comma-separated)
Save Edits
Cancel