日期:2014-05-16  浏览次数:20807 次

如何从一张表中搜索异常数据?
有几张数据表label1,有a、b、c、d、e、f这6个字段,想从其中的b、c、d、e四个字段的值中找出大于1000的,语句该如何写?

------解决方案--------------------
select * from label1
where a>1000 or b>1000 or c>1000 or d>1000 or e>1000 or f>1000
------解决方案--------------------
SQL code

select * from label1
where b > 1000 or c > 1000 or d > 1000 or e > 1000

UNION ALL 

select * from label2
where b > 1000 or c > 1000 or d > 1000 or e > 1000

UNION ALL


select * from label2
where b > 1000 or c > 1000 or d > 1000 or e > 1000

------解决方案--------------------
SQL code
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
------解决方案--------------------
探讨

SQL code

select * from label1
where b > 1000 or c > 1000 or d > 1000 or e > 1000

UNION ALL

select * from label2
where b > 1000 or c > 1000 or d > 1000 or e > 1000

UNION ALL


select * from labe……

------解决方案--------------------
SQL code

SELECT * FROM 
lable1
WHERE b>1000 OR c>1000 OR d>1000 OR e>1000;