mysql jdbc 执行 卡住_sql语句在mysql可以执行但在jdbc中不能执行

ps=dbConnection.prepareStatement("SELECT"+"t1.openidasopenId,t1.usernameasuserName,t1.mobileasuserMobile,t1.fkASnormalCard,t2.fkASgroupCard,t1.fk+t2.fkAStotalCard"+"FROM"...

ps=dbConnection.prepareStatement("SELECT "

+ "t1.openid as openId,t1.username as userName,t1.mobile as userMobile,t1.fk AS normalCard,t2.fk AS groupCard,t1.fk + t2.fk AS totalCard"

+ "FROM"

+ "("

+ "SELECT a.openid,a.username,a.usermobile AS mobile, b.fk AS fk FROM"

+ "("

+ "SELECT * FROM t_agent WHERE parentid =?"

+ ")a"

+ "LEFT JOIN ("

+ "SELECT t1.openid,t1.username, t1.usermobile AS mobile,sum(t2.reNum) AS fk"

+ " FROM t_agent t1"

+"INNER JOIN t_recharge t2 ON t2.useropenid = t1.openid"

+" WHERE"

+"t2.createTime >= ?"

+"AND ? >= t2.createTime"

+"AND t1.parentid =?"

+"GROUP BY"

+"t1.openid,"

+"t1.username,"

+"t1.usermobile"

+"ORDER BY"

+"t1.usermobile"

+") b ON a.openid = b.openid"

+ ")t1"

+ "INNER JOIN ("

+ "SELECT a.openid,a.username, a.usermobile AS mobile, b.fk AS fk "

+ " FROM"

+ "("

+ "SELECT * FROM t_agent WHERE parentid =?"

+ ")a"

+ "LEFT JOIN ("

+ "SELECT t1.openid,t1.username, t1.usermobile AS mobile,sum(t2.fk ) AS fk"

+ " FROM t_agent t1"

+ "INNER JOIN t_fklog t2 ON t1.openid = t2.openid"

+ " WHERE t2.createTime >=?"

+ "AND ? >=t2.createTime "

+ "AND t1.parentId =?"

+ "GROUP BY "

+ "t1.openid,"

+ "t1.username,"

+ "t1.usermobile"

+ " ORDER BY"

+ "t1.usermobile"

+ ") b ON a.openid = b.openid"

+ ") t2 ON t1.openid = t2.openid"

+ " ORDER BY"

+ "totalCard DESC");

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值