sql = "select voucherid,name,voucherlogo,voucherfrom,couflag,min(discount),avgprice,reviews,sname,tname,disflag from" +
" (select a.voucherid,a.name,a.voucherlogo,a.voucherfrom,a.couflag,b.discount,e.avgprice,e.reviews," +
" d.sname,c.tname,a.disflag from ((select * from zt_sh_voucher where disable=0 and status=0 and " +
" sstatus=1 and cityid="+visitorCity+" and keyword like '%"+keyword+"%') a " +
" inner join zt_sh_thrarea c on a.taid=c.taid inner join zt_sh_secsarea d on c.said=d.said " +
" inner join zt_sh_vouchershops e on a.voucherid = e.voucherid) left join (select * from zt_sh_carddiscounts where status=1 " +
" and disable=0 and date_format(starttime,'%Y-%m-%d')<='"+getToday()+"' and date_format(endtime,'%Y-%m-%d')>='"+getToday()+"') " +
" b on a.voucherid = b.voucherid) v group by v.voucherid,v.name";求这个sql语句的总条数?
" (select a.voucherid,a.name,a.voucherlogo,a.voucherfrom,a.couflag,b.discount,e.avgprice,e.reviews," +
" d.sname,c.tname,a.disflag from ((select * from zt_sh_voucher where disable=0 and status=0 and " +
" sstatus=1 and cityid="+visitorCity+" and keyword like '%"+keyword+"%') a " +
" inner join zt_sh_thrarea c on a.taid=c.taid inner join zt_sh_secsarea d on c.said=d.said " +
" inner join zt_sh_vouchershops e on a.voucherid = e.voucherid) left join (select * from zt_sh_carddiscounts where status=1 " +
" and disable=0 and date_format(starttime,'%Y-%m-%d')<='"+getToday()+"' and date_format(endtime,'%Y-%m-%d')>='"+getToday()+"') " +
" b on a.voucherid = b.voucherid) v group by v.voucherid,v.name";求这个sql语句的总条数?
解决方案 »
- mysql-udf-http 怎么在win系统下使用呢?
- 求拿 discuz7.2的方法
- EXPLAIN里的INDEX不好解释,帮忙看看
- 不显示删除回复显示所有回复显示星级回复显示得分回复 请教一条错误的SQL语句,另外如果查询条件只能用like,like能否用大于小于来确定范围?
- 求一SQL语句
- 不知道哪来的filesort! ACMAIN_CHM等请进!
- [原创] 让 MySQL 4.0.x 或 5.1.x 的全文检索(全文索引)支持中文及简易分词
- 试了CSDN上的若干方法,还是没能解决Mysql中文问题。
- mysql-error :1016
- mysql递归查询导致两次查询结果不一样,同一个方法无参
- 已知两个结构一样的查询结果,如何做筛选,不重复得到结果
- 我想要在MYSQL表中的几组数据中查询某个包含关键字的数据
OR
运行sql语句
select FOUND_ROWS()