请教一个sql语句
yqm01 2008-06-06 02:00:49 我有一张内容表content,有字段ID
一张分类表category,有个字段是tableName
还有其它的表等,其中都有一个contentID字段,对应content表中的ID
我现的语句是想查询内容表中的内容,并关联其它表(未知名称,需要从category中的tableName读取)
我是这样写的,但是不行,试了N多了,想不出了这个sql语句
select c.*,t.* from content c left join (select * from (select ca.custom_table from category ca where ca.ID = 8)) t on t.contentId = c.ID where c.ID=8
请帮忙分析一下,错在哪,或正确的写法