简体   繁体   中英

How to write this query using Hibernate Criteria

SELECT COUNT(*), 
       channel_user_id
FROM communication.interaction_user_status
WHERE channel_user_id IN ( SELECT DISTINCT channel_user_id
                           FROM communication.channel_user 
                           WHERE user_community_id = 1 
                          )
AND status = 0 
GROUP BY channel_user_id;

it depends on the type of configuration you have, usually you cannot include the database name in the query, this must be configured elsewhere

SELECT COUNT(*), 
       channel_user_id
FROM interaction_user_status
WHERE channel_user_id IN ( SELECT DISTINCT channel_user_id
                           FROM channel_user 
                           WHERE user_community_id = 1 
                          )
AND status = 0 
GROUP BY channel_user_id;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM