如何获取显示为打勾的所选记录,我只需要选择具有不同用户ID的记录及其最后条目记录。下面的查询仅获取前2条记录
SELECT LOWER(applied.job_status), applied.* FROM `jh_job_posting` as `job` JOIN `jh_job_applied` as `applied` ON `applied`.`applied_job_id` = `job`.`job_id` WHERE `job`.`job_id` = '41' GROUP BY applied.user_id ORDER by applied.user_id DESC
答案 0 :(得分:0)
是的,我终于明白了。但是带有子查询
SELECT * from jh_job_applied WHERE aid IN( SELECT Max(aid)FROM `jh_job_applied` as applied where applied.applied_job_id=41 group by applied.user_id ORder by aid DESC)