WITH A AS (
SELECT '1' AS SEQ ,'4' AS GB FROM DUAL UNION ALL
SELECT '2' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '3' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '4' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '5' AS SEQ ,'4' AS GB FROM DUAL UNION ALL
SELECT '6' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '7' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '8' AS SEQ ,'4' AS GB FROM DUAL UNION ALL
SELECT '9' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '10' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '11' AS SEQ ,'1' AS GB FROM DUAL UNION ALL
SELECT '12' AS SEQ ,'1' AS GB FROM DUAL
)
SELECT
*
FROM A
안녕하세요
이런것도 가능한지 문의드립니다.
SEQ는 일련번호이고 GB는 구분값입니다.
GB가 4부터 시작해서 다음4가 나오기 전까지 같은 번호로 부여하고 싶은데 가능한가요?
SEQ GB GRP
1 4 1
2 1 1
3 1 1
4 1 1
5 4 2
6 1 2
7 1 2
.
.
.
이런식으로 가능한지요?
|