You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
425 B

5 months ago
SELECT
o.user_id,
o4.id subject_id,
o.created_at
FROM
(SELECT i.user_id, i.shixun_id, i.created_at FROM myshixuns i WHERE i.user_id IN (SELECT id FROM users WHERE TYPE = 'User' AND (last_login_on >= 'LAST_LOGIN_TIME'))) o
LEFT JOIN subject_shixun_infos o3 ON o.shixun_id = o3.shixun_id
LEFT JOIN subjects o4 ON o3.subject_id = o4.id
WHERE o4.hidden != 1 AND o4.status = 2 and (o.created_at >= 'LAST_CREATED_TIME');