This is only a guess, but you can try this. I don't know if this will work, but you can go for it.
SELECT t1.title, t1.body, t2.cname FROM $db_tbl_announce as t1, $db_tbl_class as t2 WHERE ( t1.cid = t2.cid ) OR ( t1.cid IS NULL AND t2.cid IS NOT NULL) ORDER BY t1.aid DESC
This probably won't work too well, but you can still go for it. The problem is that there won't be the needed matching value between the two tables, I think.
RCM