并获得有意义的结果。如何结合这些查询
目前我正在这三个疑问:
SELECT t.type,t.id,s.title FROM db1.tags t INNER JOIN db1.st s ON s.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='s' ORDER BY tag desc LIMIT 0, 19
SELECT t.type,t.id,v.title FROM db1.tags t INNER JOIN db1.vi v ON v.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='v' ORDER BY tag desc LIMIT 0, 19
SELECT t.type,t.id,i.ca AS title FROM db1.tags t INNER JOIN db2.tablename i ON i.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='i' ORDER BY tag desc LIMIT 0, 19
然后尝试将数据结果结合起来,但我真的喜欢是,如果我可以将它们合并成一个单一的查询。
有什么想法?
我会把它放到嵌套查询中,虽然 – Quassnoi 2010-03-17 13:57:01
会这样做,谢谢 – mcgrailm 2010-03-17 14:19:28
ohh我必须把每个查询周围(),并移动限制和秩序的结束 – mcgrailm 2010-03-17 14:20:28