注册 登录
MySQL社区 返回首页

yy131431的个人空间 http://www.mysqlpub.com/?14366 [收藏] [复制] [RSS]

留言板

facelist doodle涂鸦板

您需要登录后才可以留言 登录 | 注册


进击の少女 2013-10-6 15:25
问个问题:string sql = "select Jname,Jnumber,t1.sum1,t2.sum2,t3.sum3,t4.sum4,t5.sum5,(isnull(t1.sum1,'')+isnull(t2.sum2,'')+isnull(t3.sum3,'')+isnull(t4.sum4,'')+isnull (t5.sum5,'')) as sum6 from " +
                "(select Jname,Jnumber,SUM(Incomeamount) sum1 from Ssfreetofees where Timeh>=" + "'" + ls_startdate12 + "'" + "and " + "Timeh<=" + "'" + Is_enddate22 +  "'  ) as t1 " +
                "left join( select Jname,Jnumber,SUM(Incomeamount) sum2 from Ssctoni where Timeh>=" + "'" + ls_startdate12 + "'" + "and " + "Timeh<=" + "'" +  Is_enddate22 + "' ) as t2 on t1.Jnumber= t2.Jnumber" +
                "left join(select Jname,Jnumber,SUM(Incomeamount)sum3 from Msfreetochangefees where Timeh>=" + "'" + ls_startdate12 + "'" + "and " + "Timeh<=" + "'" +  ls_enddate22 + "'  ) as t3 on t1.Jnumber = t3.Jnumber " +
                "left join (select Jname,Jnumber,SUM(Incomeamount) sum4 from MsNC where Timeh>=" + "'" + ls_startdate12 + "'" + "and " + "Timeh<=" + "'" + Is_enddate22  + "' group by sum4) as t4 on t1.Jnumber = t4.Jnumber " +
                "left join (select Jname,Jnumber,SUM(Incomeamount) sum5 from MsStoL where Timeh>=" + "'" + ls_startdate12 + "'" + "and " + "Timeh<=" + "'" +  Is_enddate22 + "'  ) as t5 on t1.Jnumber = t5.Jnumber " +
                 "where  t1.Jnumber <> ''";
这哪里出错了?

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-5-3 22:29 , Processed in 0.038147 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

返回顶部