This must be easier than I am making it, but I am going crazy here. What I want to do is create a view from three tables, like such:
SELECT tableA.name, tableB.id, tableB.categoryID, tableC.categoryParentID
FROM tableB, tableA where tableA.id=tableB.id JOIN tableC on
tableC.categoryID = tableB.categoryID;
Simple enough. However, what I want to accomplish is that in the case where tableB.categoryID is NULL, I want tableC.categoryParentID to show up as a NULL value rather than as the categoryParentID value.
So far with my results I either can get the table to show all the rows where tableB.categoryID IS not NULL, and exclude the rows that have a null value for categoryID entirely - I don't want to do this - OR I get some weird variation that includes every row for categoryParentID from tableC for every row from tableB - which gives me upwards of 3,000,000 rows, and is also incorrect.
If this is unclear, I can explain more.
Thanks in advance.