我有这种查询,我会尽量让它变得如此简单易懂,他的查询要大得多:)
$query = "SELECT * FROM Artist";
$query2= "SELECT * FROM News";
艺术家和新闻中的所有表格结构都是相同的行等
ID 标题 帖子
是否可以将这两个查询合二为一,并执行shuffle($ query)之类的操作;
答案 0 :(得分:2)
select ID, Title, Posts from Artist, 'Artist' as Type
union all
select ID, Title, Posts from News, 'News' as Type