mysql> select @r:=@r+1 As rowNum, T2.t_regtime,T2.t_cnt from DUMMY T1, (select substr(regtime,1,17) as t_regtime, count(1) as t_cnt from RB_OCUS_POS_TEST2 group by substr(regtime,1,17)) T2, (Select @r:=0)r;
+--------+-------------------+-------+
| rowNum | t_regtime | t_cnt |
+--------+-------------------+-------+
| 1 | 20190829 12:42:03 | 669 |
| 2 | 20190829 12:42:04 | 3021 |
| 3 | 20190829 12:42:05 | 5429 |
| 4 | 20190829 12:42:06 | 5005 |
| 5 | 20190829 12:42:07 | 3661 |
| 6 | 20190829 12:42:08 | 3310 |
| 7 | 20190829 12:42:09 | 2807 |
| 8 | 20190829 12:42:10 | 3950 |
| 9 | 20190829 12:42:11 | 4715 |
| 10 | 20190829 12:42:12 | 5130 |
| 11 | 20190829 12:42:13 | 4318 |
| 12 | 20190829 12:42:14 | 2918 |
| 13 | 20190829 12:42:15 | 2980 |
| 14 | 20190829 12:42:16 | 4156 |
| 15 | 20190829 12:42:17 | 5870 |
| 16 | 20190829 12:42:18 | 5236 |
| 17 | 20190829 12:42:19 | 5546 |
| 18 | 20190829 12:42:20 | 5367 |
| 19 | 20190829 12:42:21 | 3181 |
| 20 | 20190829 12:42:22 | 2807 |
| 21 | 20190829 12:42:23 | 2554 |
| 22 | 20190829 12:42:24 | 1379 |
| 23 | 20190829 12:42:25 | 4924 |
| 24 | 20190829 12:42:26 | 4724 |
| 25 | 20190829 12:42:27 | 5641 |
| 26 | 20190829 12:42:28 | 5661 |
| 27 | 20190829 12:42:29 | 3936 |
| 28 | 20190829 12:42:30 | 3557 |
| 29 | 20190829 12:42:31 | 4186 |
| 30 | 20190829 12:42:32 | 4821 |
| 31 | 20190829 12:42:33 | 4621 |
| 32 | 20190829 12:42:34 | 4697 |
| 33 | 20190829 12:42:35 | 3264 |
| 34 | 20190829 12:42:36 | 3706 |
| 35 | 20190829 12:42:37 | 2423 |
| 36 | 20190829 12:42:38 | 2043 |
| 37 | 20190829 12:42:39 | 4207 |
| 38 | 20190829 12:42:40 | 3524 |
| 39 | 20190829 12:42:41 | 4656 |
| 40 | 20190829 12:42:42 | 3582 |
| 41 | 20190829 12:42:43 | 2995 |
| 42 | 20190829 12:42:44 | 120 |
+--------+-------------------+-------+
42 rows in set (0.25 sec)
mysql>
'데이타베이스 > MySQL' 카테고리의 다른 글
MySQL innoDB 에서 INSERT 하는 속도를 MyISAM 과 유사하게 변경하는 방법 (0) | 2021.05.28 |
---|---|
TIP - SEQ증감 (0) | 2019.10.31 |
select T2.t_cnt from DUMMY T1, (select substr(regtime,1,17) as t_regtime, count(1) as t_cnt from RB_OCUS_POS_TEST2 group by substr(regtime,1,17)) T2 where T2.t_cnt > 3000; (0) | 2019.10.31 |
FUNCTION 생성및 활용 (0) | 2019.10.31 |
LINUX,프로그래밍을 통한 PROCEDURE 호출후 결과 (0) | 2019.10.30 |