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

[BE] fix: 쿼리 문법 수정 #358

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Conversation

donghoony
Copy link
Contributor

@donghoony donghoony commented Aug 14, 2024


🚀 어떤 기능을 구현했나요 ?

  • MySQL이 붙은 뒤로 동작하지 않던 쿼리문을 수정했습니다.

🔥 어떻게 해결했나요 ?

  • 쿼리를 조금 만졌습니다. 이전 쿼리가 지금 봐도 이상~하긴 했네요

AS-IS

SELECT o.id FROM option_item o
LEFT JOIN checkbox_answer ca
LEFT JOIN checkbox_answer_selected_option c
ON c.checkbox_answer_id = ca.id
WHERE ca.review_id = :reviewId
AND c.selected_option_id = o.id

TO-BE

SELECT o.id FROM option_item o
LEFT JOIN checkbox_answer_selected_option c
ON c.selected_option_id = o.id
LEFT JOIN checkbox_answer ca
ON c.checkbox_answer_id = ca.id
WHERE ca.review_id = :reviewId

📝 어떤 부분에 집중해서 리뷰해야 할까요?

  • 같은 부분 다른 sql도 고쳤습니다.

📚 참고 자료, 할 말

image

SQL은 LEFT JOIN + ON이 필수인 듯하네요 😢

Copy link

Test Results

58 tests   58 ✅  2s ⏱️
22 suites   0 💤
22 files     0 ❌

Results for commit 4d47e4d.

Copy link
Contributor

@skylar1220 skylar1220 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비상프루브

Copy link
Contributor

@Kimprodp Kimprodp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비상

Copy link
Contributor

@nayonsoso nayonsoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상비!!!

@donghoony donghoony merged commit 1441047 into develop Aug 15, 2024
6 checks passed
@donghoony donghoony deleted the be/fix/356-mysql-query-fix branch August 16, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BE] MySQL에서 동작하지 않는 쿼리를 수정한다.
4 participants