N_START_TIME SZ_ID
--------------------------------
1265277408 DAMI2000
1265277467 DAMI2000
1265277528 DAMI2000
1265277588 DAMI2000
1265277648 DAMI2000
1265277708 DAMI2000
1265277767 DAMI2000
1265277827 DAMI2000
1265277887 DAMI2000
1265278086 DAMI2000
1265278159 DAMI2000
1265278224 DAMI2000
1265246139 LINU92
1265269958 LINU92
1265270019 LINU92
1265270631 LINU92
1265270680 LINU92
위의 데이터를 N_START_TIME 순으로 번호를 매기고 싶습니다.(오른차순)
JOIN과 GROUP BY 구문을 통해 해답은 구했지만,
SELECT만을 이용해 구하고 싶습니다.
SELECT ( SUM( SELECT ???????) )
FROM 데이터
ORDER BY SZ_ID, N_START_TIME ASC
한 row씩 나오는 데이터를 현재까지 scan된 데이터의 합으로 순번을 매기고 싶은데
방법이 없을까요?
(sql 2000입니당)
원하는 결과 :
N_START_TIME SZ_ID N_IDX
---------------------------------------------------------
1265246139 DAMI2000 1
1265273373 DAMI2000 2
1265273448 DAMI2000 3
1265273524 DAMI2000 4
1265273596 DAMI2000 5
1265273668 DAMI2000 6
1265273743 DAMI2000 7
1265273812 DAMI2000 8
1265273887 DAMI2000 9
1265273954 DAMI2000 10
1265274022 DAMI2000 11
1265276112 DAMI2000 12
1265276178 DAMI2000 13
1265276306 DAMI2000 14
1265276366 DAMI2000 15
1265276425 DAMI2000 16
1265276502 DAMI2000 17
1265276562 DAMI2000 18
1265276612 DAMI2000 19
1265276672 DAMI2000 20
1265276732 DAMI2000 21
1265276792 DAMI2000 22
1265276852 DAMI2000 23
1265276911 DAMI2000 24
1265276971 DAMI2000 25
1265277030 DAMI2000 26
1265277109 DAMI2000 27
1265277169 DAMI2000 28
1265277229 DAMI2000 29
1265277289 DAMI2000 30
1265277348 DAMI2000 31
1265277408 DAMI2000 32
1265277467 DAMI2000 33
1265277528 DAMI2000 34
1265277588 DAMI2000 35
1265277648 DAMI2000 36
1265277708 DAMI2000 37
1265277767 DAMI2000 38
1265277827 DAMI2000 39
1265277887 DAMI2000 40
1265278086 DAMI2000 41
1265278159 DAMI2000 42
1265278224 DAMI2000 43
1265246139 LINU92 1
1265269958 LINU92 2
1265270019 LINU92 3
1265270631 LINU92 4
1265270680 LINU92 5
tt |