Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

쿼리 개선 #846

Open
Paul2021-R opened this issue Feb 12, 2024 · 0 comments
Open

쿼리 개선 #846

Paul2021-R opened this issue Feb 12, 2024 · 0 comments

Comments

@Paul2021-R
Copy link
Contributor

          쿼리문 개선안 드립니당... 서브쿼리는 성능이 좋지 않아 왠만하면 조인을 이용하는게 좋다고 알고 있어서 조인을 쓰시는 버전은 어떤지 봐주세요 이 쿼리로는 for each 돌필요없이 result set에서 바로 equal 비교 가능합니당

select count(*) as count, tj.max from team_job tj left join team_user_job tuj on tuj.team_job_id = tj.team_job_id and tuj.status = 'APPROVED' where tj.team_id = 20 and tj.name = '아이패드' group by tj.max;
where절에 tj.team_id랑 tj.name을 param으로 채우시면 되용

Originally posted by @sinryuji in #836 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant