- I have a tablewith 886 columns being allFLOATtypeand 700000 row,
- would need to do a selectas below, butforall 886 columns.
DECLARE @Min float, @Max float;
set @Min = 0.9
set @Max = 1.1
SELECT [A],{B], [C],... [AHB]
FROM [names] where
[A]>(SELECTround(avg([A]), 2)* @min FROM [Names])and [A] )* @Max FROM [names])and
[B]>(SELECTround(avg([B]), 2)* @min FROM [Names])and [B] )* @Max FROM [names])and
[C]>(SELECTround(avg([C]), 2)* @min FROM [Names])and [C] )* @Max FROM [names])and
[A]>(SELECTround(avg([AHB]), 2)* @min FROM [Names])and [AHB])* @Max FROM [names])
- VERY SLOW, SLOW
- and also
- make the clause where based on the column meanand 3 times the standard deviation of the column.
select [A],{B], [C],... [AHB]
from [nomes] where
[A] >((SELECT round(avg([A]),2)FROM [nomes]) -(2 *((SELECT round(stdev([A]),2) FROM [nomes]))))and
[A] <((SELECT round(avg([A]),2) FROM [nomes]) +(1 *((SELECT round(stdev([A]),2) FROM [nomes])))) AND
[B] >((SELECT round(avg([B]),2)FROM [nomes]) -(2 *((SELECT round(stdev([B]),2) FROM [nomes]))))and
[B] <((SELECT round(avg([B]),2) FROM [nomes]) +(1 *((SELECT round(stdev([B]),2) FROM [nomes])))) AND
[C] >((SELECT round(avg([C]),2)FROM [nomes]) -(2 *((SELECT round(stdev([C]),2) FROM [nomes]))))and
[C] <((SELECT round(avg([C]),2) FROM [nomes]) +(1 *((SELECT round(stdev([C]),2) FROM [nomes])))) AND
[AHB] >((SELECT round(avg([AHB]),2)FROM [nomes]) -(2 *((SELECT round(stdev([AHB]),2) FROM [nomes]))))and
[AHB] <((SELECT round(avg([AHB]),2) FROM [nomes]) +(1 *((SELECT round(stdev([AHB]),2) FROM [nomes]))))
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Helvetica} span.s1 {color: #929292} </style>