问题:
运行后提示SQL语句过长,想改成嵌套格式的,写的代码又错误,看书看得也不太通,谁能帮忙改一下?
Select shuzi From baiwtcp3.dbf Into ARRAY xwj order by zhqw desc
Select shuzi From shiwtcp3.dbf Into ARRAY xqj order by zhqw desc
Select shuzi From gewtcp3.dbf Into ARRAY xbl order by zhqw desc
Select shuzi From shiwp345.dbf Into ARRAY xui order by zhqw desc
Select shuzi From gewp345.dbf Into ARRAY xge order by zhqw desc
Select shuzi From kwtcp3.dbf Into ARRAY xkq order by zhqw desc
Select shuzi From kwp345.dbf Into ARRAY xkh order by zhqw desc
Select shuzi From kwp245.dbf Into ARRAY xkv order by zhqw desc
Select shuzi From hwtcp3.dbf Into ARRAY xhq order by zhqw desc
Select shuzi From hwp345.dbf Into ARRAY xhh order by zhqw desc
Select shuzi From hwp245.dbf Into ARRAY xhv order by zhqw desc
select *;
from p5.dbf ;
where (p5.wjw+p5.qmw+p5.blw)-10*(int(0.1*(p5.wjw+p5.qmw+p5.blw))) in (xhq[1],xhq[2],xhq[3],xhq[4],xhq[5],xhq[9]);
and (p5.gew+p5.uiw+p5.blw)-10*(int(0.1*(p5.gew+p5.uiw+p5.blw))) in (xhh[1],xhh[2],xhh[3],xhh[4],xhh[5],xhq[9]);
and (p5.uiw+p5.qmw+p5.gew)-10*(int(0.1*(p5.uiw+p5.qmw+p5.gew))) in (xhv[1],xhv[2],xhv[3],xhv[4],xhv[5],xhq[9]);
AND p5.wjw in (xwj[1],xwj[2],xwj[3],xwj[4],xwj[5],xwj[10]);
and p5.qmw in (xqj[1],xwj[2],xqj[3],xqj[4],xqj[5],xqj[10]);
and p5.blw in (xbl[1],xbl[2],xbl[3],xbl[4],xbl[5],xbl[10]);
and p5.uiw in (xui[1],xui[2],xui[3],xui[4],xui[5],xui[10]);
and p5.gew in (xge[1],xge[2],xge[3],xge[4],xge[5],xge[10]);
and (max(wjw,qmw,blw)-min(wjw,qmw,blw)) in (xkq[1],xkq[2],xkq[3],xkq[4],xkq[5],xkq[9]);
and (max(uiw,gew,blw)-min(uiw,gew,blw)) in (xkh[1],xkh[2],xkh[3],xkh[4],xkh[5],xkh[9]);
and (max(qmw,uiw,gew)-min(qmw,gew,uiw)) in (xkv[1],xkv[2],xkv[3],xkv[4],xkv[5],xkv[9]);