DB 쿼리 부분 질문 좀 할께요 - 영카트 부분인데 여기 급하게 질문 합니다. 정보
DB 쿼리 부분 질문 좀 할께요 - 영카트 부분인데 여기 급하게 질문 합니다.
본문
회사 프로젝트로 영카트 쓰고 있는데, 아이고 회사에서 사용하고 있는 (영카트를 구매한) ID 와 비번을 까먹어서 지금 제 아이디로 이렇게 질문 하네요 ㅜㅜ
select COUNT(mb_id) as cnt, mb_id from yc4_order having sum(od_receipt_bank + od_receipt_card - od_cancel_card - od_dc_amount - od_refund_amount) > ".$temp_rank2[amount]."
GROUP BY mb_id
내가 구매한 총 액에 대한 전체 회원의 랭킹을 구하는 쿼리문 입니다.
현재 내가 구매한 총 금액 ($temp_rank2[amount]) 에 대해 나보다 금액이 많은 사람의 수를 구해 나의 현재 랭킹을 산출 하는 방법인데요,
select COUNT(mb_id) as cnt, mb_id from yc4_order having sum(od_receipt_bank + od_receipt_card - od_cancel_card - od_dc_amount - od_refund_amount) > 0 GROUP BY mb_id
1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY mb_id' at line 2
error file : /_main/shop/mypage.php
이러한 에러가 뜨네요 ^.ㅜㅜㅜㅜㅜㅜ
서브쿼리는 지원 안되는 4.0 버전의 MySQL 입니다.
에러 뜨는 원인이 뭘까요 ㅜㅜㅜ 해결 법좀 알려 주실 분 ㅜㅜ?!
select COUNT(mb_id) as cnt, mb_id from yc4_order having sum(od_receipt_bank + od_receipt_card - od_cancel_card - od_dc_amount - od_refund_amount) > ".$temp_rank2[amount]."
GROUP BY mb_id
내가 구매한 총 액에 대한 전체 회원의 랭킹을 구하는 쿼리문 입니다.
현재 내가 구매한 총 금액 ($temp_rank2[amount]) 에 대해 나보다 금액이 많은 사람의 수를 구해 나의 현재 랭킹을 산출 하는 방법인데요,
select COUNT(mb_id) as cnt, mb_id from yc4_order having sum(od_receipt_bank + od_receipt_card - od_cancel_card - od_dc_amount - od_refund_amount) > 0 GROUP BY mb_id
1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY mb_id' at line 2
error file : /_main/shop/mypage.php
이러한 에러가 뜨네요 ^.ㅜㅜㅜㅜㅜㅜ
서브쿼리는 지원 안되는 4.0 버전의 MySQL 입니다.
에러 뜨는 원인이 뭘까요 ㅜㅜㅜ 해결 법좀 알려 주실 분 ㅜㅜ?!
댓글 전체

아이고 해결 했습니다. having 을 group by 다음에 넣어야 하는데 제가 뭔 짓을 한건지 ㅜㅜㅜㅜㅜ