选取合适条件的内容语法:
select * from `$old3` where oldyear='$uy' and oldmonth='$um' and oldday='$ud' UNION ALL select * from `$old1` where oldyear='$uy' and oldmonth='$um' and oldday='$ud' UNION ALL select * from `$old2` where oldyear='$uy' and oldmonth='$um' and oldday='$ud'
选取出全部内容语法:
select * from `$old3` UNION ALL select * from `$old1` UNION ALL select * from `$old2`
注释:默认地,UNION 操作符选取不同的值。如果允许重复的值,请使用 UNION ALL。
UNION 操作符用于合并两个或多个 SELECT 语句的结果集。
请注意,UNION 内部的 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每条 SELECT 语句中的列的顺序必须相同。
评论