|
SELECT CUR_LOSS,MIN_LOSS,MAX_LOSS,IF (CUR_LOSSMAX_LOSS,1,0) FROM ( ( SELECT loss AS CUR_LOSS ,1 as rn1 FROM deal_pai_model_mind_recall_check where ds=(select(regexp_replace(substr(date_sub(FROM_UNIXTIME(UNIX_TIMESTAMP()),1),1,10),'-',''))) ) aLEFT JOIN ( SELECT (avg(loss)-2*STDDEV(loss)) AS MIN_LOSS ,1 as rn2 FROM deal_pai_model_mind_recall_check where ds(select(regexp_replace(substr(date_sub(FROM_UNIXTIME(UNIX_TIMESTAMP()),14),1,10),'-',''))) ) bon a.rn1=b.rn2LEFT JOIN ( SELECT (avg(loss)+3*STDDEV(loss)) AS MAX_LOSS ,1 as rn3 FROM deal_pai_model_mind_recall_check where ds(select(regexp_replace(substr(date_sub(FROM_UNIXTIME(UNIX_TIMESTAMP()),14),1,10),'-',''))) ) c on a.rn1=c.rn3);
|
|