标签: java hibernate jpa
DELETE FROM table_name WHERE NOT IN ( SELECT id FROM table_name WHERE user_id = 1 ORDER BY date DESC LIMIT 50 )
我尝试过创建子查询,但它似乎不允许您设置ORDER BY或LIMIT值。