求一将mysql一数据库下多表循环合并查询语句?
$str="SELECT * FROM talbe having ( 姓名 like '%奥巴马%'||职业 like '%政治家%') limit ".($page-1)*$num."
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $conn=@mysql_connect("localhost","root","123456","test");//连接test数据库后,如何将test下的各个表合并查询输出结果? 貌似 for(...){//循环求出表名 .... tableabcxyz= talbe1,talbe2,...talbe3 } $str="SELECT * FROM talbeabcxyz having ( 职业 like '%医生%') limit ".($page-1)*$num." ....
select o.oid,l.lid,c.cid,comName,comPrice,ordTime from mis_order o,mis_link l,mis_commodity c where o.oid=l.lid and c.cid=l.cid; <br><font color="#e78608">------解决方案--------------------</font><br>talbe 就没懂啥意思...table就有点明白了...<br><br>select name from table1 where name like "obama%"<br>union<br>select name from table2 where name like "obama%"<br><br><br>尝试使用union操作,但注意select出来的列数必须一致,不一致的可以用null补充 <br><font color="#e78608">------解决方案--------------------</font><br>