Home >Backend Development >PHP Tutorial >求大神解答一个数据库语句的有关问题
求大神解答一个数据库语句的问题
<br />SELECT `id` , `time` , `title`<br />FROM `think_infor`<br />WHERE `type` LIKE '$k-%'<br /> <br />UNION ALL<br /> <br />SELECT `id` , `time` , `title`<br />FROM `think_infor2`<br />WHERE `type` LIKE '$k-%'<br /> <br />ORDER BY `time` DESC<br />LIMIT 0,6<br />
SELECT `id` , `time` , `title`, 'think_infor' as tbl_name<br /> FROM `think_infor`<br /> WHERE `type` LIKE '$k-%'<br />UNION<br />SELECT `id` , `time` , `title`, 'think_infor2' <br /> FROM `think_infor2`<br /> WHERE `type` LIKE '$k-%'<br />ORDER BY `time` DESC<br />LIMIT 0,6