mysql 怎么在多张表找查数据
发布网友
发布时间:2022-05-02 13:30
我来回答
共2个回答
热心网友
时间:2022-05-02 14:59
select * from help where title ='123'
union all
select * from new where title='123'
order by date desc;
要求这2帐表的字段相同 数据类型相同。追问谢谢你!
$_rows = mysql_query("SELECT jt_id,jt_title,jt_date FROM jt_policy WHERE jt_title LIKE '%{$_POST['keyword']}%'
UNION ALL
SELECT jt_id,jt_title,jt_date FROM jt_help WHERE jt_title LIKE '%{$_POST['keyword']}%'
UNION ALL
SELECT jt_id,jt_title,jt_date FROM jt_new WHERE jt_title LIKE '%{$_POST['keyword']}%' ORDER BY jt_date DESC
");
热心网友
时间:2022-05-02 16:17
select * from help where title ='123'
union all
select * from new where title='123'
order by date desc;