1
我正在通过sql执行此操作,但是我想在hql中执行此操作,select(select count(*)...)中的语句不适用于hql,任何消化和优化将不胜感激将sql转换为hql
SELECT u.username,u.device_tocken,sr.count
from users u,
(select count(*) as count ,ssr.recepient as res from survey_recipient ssr where
(ssr.is_read is false and ssr.recepient in ('abc','xyz'))group by ssr.recepient) sr
where
(u.username = sr.res and u.device_tocken is not null)