Hi,
I have the following SQL query, which is selecting from 10 different tables…
SELECT * FROM
ConfPaper c,
JournalArticle j,
EdBookChapter eb,
Thesis t,
Patent p,
Monograph m,
Unpublished u,
Misc ms,
Website w,
TechReport tr
LEFT JOIN Category ct
ON
ct.CTid = c.Pid AND ct.CTid = j.Pid AND ct.CTid = eb.Pid
AND ct.CTid = t.Pid AND ct.CTid = p.Pid AND ct.CTid = m.Pid
AND ct.CTid = u.Pid AND ct.CTid = ms.Pid AND ct.CTid = w.Pid
AND ct.CTid = tr.Pid
WHERE
c.CPdeleted = 0 AND j.JAdeleted = 0 AND eb.EBCdeleted = 0
AND t.THdeleted = 0 AND p.PTdeleted = 0 AND m.MOdeleted = 0
AND u.UNdeleted = 0 AND ms.MIdeleted = 0 AND w.WSdeleted = 0
AND tr.TRdeleted = 0
ORDER BY rand()
LIMIT 6
But i keep getting an error saying “Unknown column c.Pid” when this column DOES exist…?
Any ideas why i am having this problem, also can i improve this sql query in any way?
Thanks