SELECT 사용자ID, 닉네임, 전체주소, 전화번호
FROM USED_GOODS_BOARD, USED_GOODS_USER
WHERE 중고 거래 게시글을 3건이상 등록
ORDER BY 회원아이디 내림차순
SELECT E.WRITER_ID
FROM(
SELECT WRITER_ID, COUNT(*) 숫자
FROM USED_GOODS_BOARD
GROUP BY WRITER_ID) E
WHERE E.숫자 >= 3;
SELECT B.WRITER_ID, COUNT()
FROM USED_GOODS_BOARD B JOIN USED_GOODS_USER U ON B.WRITER_ID = U.USER_ID
GROUP BY B.WRITER_ID
HAVING COUNT() >= 3;
SELECT USER_ID, NICKNAME, CITY || ' ' || STREET_ADDRESS1 || ' ' || STREET_ADDRESS2 전체주소
, SUBSTR(TLNO, 1, 3) || '-' || SUBSTR(TLNO, 4, 4) || '-' || SUBSTR(TLNO, 8) 전화번호
FROM USED_GOODS_USER
WHERE USER_ID IN (SELECT E.WRITER_ID
FROM(
SELECT WRITER_ID, COUNT(*) 숫자
FROM USED_GOODS_BOARD
GROUP BY WRITER_ID) E
WHERE E.숫자 >= 3)
ORDER BY USER_ID DESC;
JOIN 써주고 GROUP BY로 묶어주니까 식이 더 깔끔하다