几个SQL语句(备忘)
1.三涨停 select biao1.代码,biao1.名称 from biao1,biao2,biao3 where (biao1.涨幅+ biao2.涨幅+biao3.涨幅)>0.27 and (biao1.代码
= biao2.代码) and (biao2.代码 = biao3.代码) and not exists (select * from biaoxg where 代码=biao1.代码)
2.二涨停
select biao1.代码,biao1.名称 from biao1,biao2 where (biao1.涨幅+ biao2.涨幅)>0.18 and (biao1.代码 = biao2.代码)
and not exists (select * from biaoxg where 代码=biao1.代码)
3.一涨停
select biao1.代码,biao1.名称 from biao1 where biao1.涨幅>0.09 and not exists (select * from biaoxg where 代码
=biao1.代码)
4.跌停再 涨停 select biao1.代码,biao1.名称 from biao1,biao2 where biao1.涨幅>0.09 and biao2.涨幅<-0.09 and (biao1.代码 = biao2.
代码)
5.锤子 select biao1.代码,biao1.名称 from biao1 where biao1.今开=biao1.最高 and biao1.最新>biao1.最低 and ((biao1.最新-
biao1.最低)/biao1.最低)>0.03
select biao2.代码,biao2.名称 from biao2 where biao2.今开=biao2.最高 and biao2.最新>biao2.最低 and ((biao2.最新-
biao2.最低)/biao2.最低)>0.03
select biao3.代码,biao3.名称 from biao3 where biao3.今开=biao3.最高 and biao3.最新>biao3.最低 and ((biao3.最新-
biao3.最低)/biao3.最低)>0.03
select biao4.代码,biao4.名称 from biao4 where biao4.今开=biao4.最高 and biao4.最新>biao4.最低 and ((biao4.最新-
biao4.最低)/biao4.最低)>0.03
6. select t2.a1 as a11 ,t2.a2 as a22, t2.a3 as a33 ,t2.a4 as a44,t2.a6 as a66,t1.a1 as b1 from xg as t1 left JOIN (select a2,a1,a3,a4,a6 from hqlsz where a1='''+ Rdate[0]+''' ) as t2 on t2.a2=t1.a2 order by t1.a1 desc