boy0704 发表于 2007-4-25 16:27:31

看看这个语句哪错了?(急)

strSql = "select * from (" +strSql+ ") as A where A.FSSJ &gt;= '"+strfssjQ+"'";<p>运行后出现debug Database:</p><p>select * from (select S.FSSJ,S.YWDM,S.CONTENT,F.CLBZ,F.WGFSSJ,S.ID,F.MSJH,D.NSRSBH,Q.MC,S.CZYBM from WG_PLFSSJTEMP_CLONE S,WG_PLFSSJFJTEMP_CLONE F,XT_SJQYDY D,YW_QYXX Q where S.ID = F.SJ_ID and F.MSJH = D.SJH and D.NSRSBH=Q.NSRSBH&nbsp; and (S.CZYBM in (select CZYDM from YW_CZYXX where&nbsp; SWJGDM = '') or S.CZYBM like '%自动发送程序%')) as A where A.FSSJ &gt;= '2005-04-24 13:31:15' and A.FSSJ &lt;= '2007-04-25 13:31:15' order by A.ID</p><p>运行不过去~~错误:as附近有错。</p><p>哪个高手给看看哈~~</p>

boy0704 发表于 2007-4-25 17:32:59

源程序

<p>&nbsp;strSql=sql_top+" from WG_PLFSSJTEMP_CLONE S,WG_PLFSSJFJTEMP_CLONE F,XT_SJQYDY D,YW_QYXX Q";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql=sql_top+" from WG_PLFSSJTEMP S,WG_PLFSSJFJTEMP F,XT_SJQYDY D,YW_QYXX Q";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql=strSql + " where S.ID = F.SJ_ID and F.MSJH = D.SJH and D.NSRSBH=Q.NSRSBH "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +" and (S.CZYBM in (select CZYDM from YW_CZYXX where&nbsp; SWJGDM = '"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + strSwjgdm + "') or S.CZYBM like '%自动发送程序%')";</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strfssjQ == null) &amp;&amp; !strfssjQ.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = "select * from (" +strSql+ ") as A where A.FSSJ &gt;= '"+strfssjQ+"'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strfssjZ == null) &amp;&amp; !strfssjZ.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql+" and A.FSSJ &lt;= '" + strfssjZ + "'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strNSRSBH == null) &amp;&amp; !strNSRSBH.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql+" and A.NSRSBH like '%" + strNSRSBH + "%'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strNSRMC == null) &amp;&amp; !strNSRMC.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql+" and A.MC like '%" + strNSRMC + "%'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strSJH == null) &amp;&amp; !strSJH.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql+" and A.MSJH like'%" + strSJH + "%'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strNR == null) &amp;&amp; !strNR.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql + " and A.CONTENT like '%" + strNR + "%'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strYWDM == null) &amp;&amp; !strYWDM.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql + " and A.YWDM='" + strYWDM + "'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strClbz == null) &amp;&amp; !strClbz.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql + " and A.CLBZ='" + strClbz + "'";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(strFsr == null) &amp;&amp; !strFsr.equals("")) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String strFsrdm=getFsrxx(null,strFsr);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!(strFsrdm == null) &amp;&amp; !"".equals(strFsrdm)){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql=strSql + " and A.CZYBM = '"+strFsrdm+"' ";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!"1".equals(strQx)){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String strFsrdm=getFsrxx(null,strFsr);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!(strFsrdm == null) &amp;&amp; !"".equals(strFsrdm)){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql=strSql + " and A.CZYBM = '"+strFsrdm+"' ";<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSql = strSql + " order by A.ID";</p><p>哪位大虾给看看啊!!</p>

ehxz 发表于 2007-4-25 17:44:50

<p>AS A</p><p>做什么?</p>

kingofse 发表于 2007-4-26 13:14:38

表达不清楚啊

&nbsp;&nbsp;&nbsp; 需要说明一下

boy0704 发表于 2007-4-30 11:04:05

<p>就是先通过查找,把符合条件的找出来后,以虚拟表的形式被另一个语句调用。我同事实现了该方法,不过他去出差了......我还是等他来了帮我吧。呵呵~~</p>
页: [1]
查看完整版本: 看看这个语句哪错了?(急)

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com