SELECT * FROM (SELECT u.mobile as mobile, SUM(log.playTime) as playCount
,if(exists (select uv.userId from ivmall.user_vip uv where uv.vipId= 12 and uv.userId = log.accountId),'true','false') as userType
FROM ${tableName} log,ivmall.`user` u
WHERE
log.accountId != ''
AND log.playTime > 0
AND log.playTime <= 7200
AND log.contentId <> 'null'
AND log.contentId <> 'none'
AND u.id = log.accountId
AND log.reportTime >= '2014-08-01 00:00:00'
AND log.reportTime <= '2014-08-31 23:59:59'
AND u.mobile <> '18612481649'
GROUP BY log.accountId
ORDER BY CAST(log.accountId AS SIGNED) ASC
)tab
exists用法 查询用户观看时长,是否为正式用户
最新推荐文章于 2021-04-22 13:57:41 发布