select * from label1 where a>1000 or b>1000 or c>1000 or d>1000 or e>1000 or f>1000
select * from label1 where b > 1000 or c > 1000 or d > 1000 or e > 1000UNION ALL select * from label2 where b > 1000 or c > 1000 or d > 1000 or e > 1000UNION ALL select * from label2 where b > 1000 or c > 1000 or d > 1000 or e > 1000 你可以写成存储过程,传递表的个数和判断条件,在存储过程中使用动态sql进行查询生成
SELECT * FROM lable1 WHERE a>1000 or b>1000 OR c>1000 OR d>1000 OR e>1000 OR f>1000;
select * from label1 where b>1000 or c>1000 or d>1000 or e>1000 or f>1000
+1 或者用存储过程生成动态SQL。
SELECT * FROM lable1 WHERE b>1000 OR c>1000 OR d>1000 OR e>1000;
where a>1000 or b>1000 or c>1000 or d>1000 or e>1000 or f>1000
select * from label1
where b > 1000 or c > 1000 or d > 1000 or e > 1000UNION ALL select * from label2
where b > 1000 or c > 1000 or d > 1000 or e > 1000UNION ALL
select * from label2
where b > 1000 or c > 1000 or d > 1000 or e > 1000
你可以写成存储过程,传递表的个数和判断条件,在存储过程中使用动态sql进行查询生成
lable1
WHERE a>1000 or b>1000 OR c>1000 OR d>1000 OR e>1000 OR f>1000;
where b>1000 or c>1000 or d>1000 or e>1000 or f>1000
或者用存储过程生成动态SQL。
SELECT * FROM
lable1
WHERE b>1000 OR c>1000 OR d>1000 OR e>1000;