PCHomepage
Programmer
The query below is a simple and functional one that is bringing results but it is not bringing results when lc2.BaseCategory is empty as it sometimes is. When it has a value, it must match lc.ID but when it's empty, I still need the other data. I used to be a wiz at this but I'm afraid I've gotten quite rusty so can someone please assist?
Code:
SELECT lc2.ID, lc.CategoryName AS BaseCategory, lc2.CategoryName AS SubCategory,
sp.PathName, lc2.SubFolder, lc2.FileName
FROM lookup_categories lc, lookup_categories lc2, site_paths sp
WHERE lc.SitePath = sp.ID
[COLOR=red]AND lc2.BaseCategory = lc.ID[/color]
GROUP BY lc.CategoryName, SubCategory
ORDER BY lc.CategoryName