답변 2개 / 댓글 3개
채택된 답변
+20 포인트
2022-07-29 (금) 12:39:42
select count(it_id) as cnt from (select it_id from g5_shop_item group by it_id ) as a
답변에 대한 댓글 2개
2022-07-29 (금) 13:57:02
조나단입니다
2022-07-29 (금) 07:10:42
select count(*) from table group by it_id
답변에 대한 댓글 1개
2022-07-29 (금) 08:35:13
select it_id, count(*) from table group by it_id
답변을 작성하려면 로그인이 필요합니다.


이렇게 처리 햇는데 수치 나오는거 보니까 맞긴 한거 같더라구요. 아래 문법이 맞는건가요?
$sql = " select count(distinct it_id) as cnt from `g5_nft_ownership` where mb_id = '".$member['mb_id']."' and it_qty > 0 ";
$cnt_1 = sql_fetch($sql);
같은 it_id 는 그냥 1개로 처리하고 전체 카운트 출력..