select sm.*
from system_mail sm
left join (SELECT u.mail_code
from user_mail u
where u.to_user = 1 ) um
on sm.mail_id = um.mail_code
where um.id is null.
这个sql在mysql中运行得很好,但是在springdatajpa中运行得不好,我如何在springdatajpa中使用它呢?
1条答案
按热度按时间qjp7pelc1#
您应该尝试强制使用db引擎来运行sql
nativeQuery = true
: