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.
答案 0 :(得分:1)
您应该尝试强制使用DB Engine通过nativeQuery = true
运行SQL:
@Query(nativeQuery = true, value="...yourqueryhere...")