oracle语句是: select a.amid as pageid,a.asid as areaid,a.adid as adnum,a.endtime,a.ispay,nvl(b.hitscount,0) as hitscount,a.title
from Ads a
left join
(select areaid,sum(hitscount) as hitscount,adnum from Adscount
where areaid=#intval1# and recordtime >= #strval1# and recordtime <= #strval2#
group by areaid,adnum) b
on a.asid=b.areaid and a.adid=b.adnum
where a.asid = #intval1# and a.isdel='0'
order by a.orderid desc
我现在用的数据库是Mysql 请问改怎么转!谢谢!
from Ads a
left join
(select areaid,sum(hitscount) as hitscount,adnum from Adscount
where areaid=#intval1# and recordtime >= #strval1# and recordtime <= #strval2#
group by areaid,adnum) b
on a.asid=b.areaid and a.adid=b.adnum
where a.asid = #intval1# and a.isdel='0'
order by a.orderid desc
我现在用的数据库是Mysql 请问改怎么转!谢谢!
a.endtime,a.ispay,IFNULL(b.hitscount,0) as hitscount,a.title
from Ads a
left join
(
select areaid,sum(hitscount) as hitscount,adnum from Adscount
where areaid=XX and recordtime >= 'strval1' and recordtime <= 'strval2'
group by areaid,adnum
) b
on a.asid=b.areaid and a.adid=b.adnum
where a.asid = XX and a.isdel='0'
order by a.orderid desc;
from Ads a
left join
(select areaid,sum(hitscount) as hitscount,adnum from Adscount
where areaid=#intval1# and recordtime >= #strval1# and recordtime <= #strval2#
group by areaid,adnum) b
on a.asid=b.areaid and a.adid=b.adnum
where a.asid = #intval1# and a.isdel='0'
order by a.orderid desc
#intval1#:intval1是变量名?areaid字段类型?