네로개발일기

개발자 네로의 개발 일기, 자바를 좋아합니다 !

반응형

jpql delete query with join condition

DELETE FROM Post p
 WHERE p IN 
 (SELECT post FROM Project project
  JOIN project.posts post
  WHERE project.id = post.project.id)

sql delete query with join condition

DELETE posts
FROM posts
INNER JOIN projects ON projects.project_id = posts.project_id
WHERE projects.client_id = :client_id
728x90
반응형
blog image

Written by ner.o

개발자 네로의 개발 일기, 자바를 좋아합니다 !