---------------------------------------- SQL 1
select a.rank, count(*) NO from DCode a where a.Code like '1233121%' group by rank order by a.RANK
rank NO
7 1
8 5
9 25
10 100
11 500
---------------------------------------- SQL 2
select rank,COUNT from DCodeCount where codeid in (select MIN(codeid) from DCode where Code like '1233121%')
rank COUNT
7 1
8 5
9 25
----------- SQL : 제가 원하는 SQL 결과물이 다음과 같이 나오게 하려면 어떻게 해야하나요?
rank NO COUNT
7 1 1
8 5 5
9 25 25
10 100
11 500
답변 감사드립니다.
|