현재시간이 2016-02-18 11:23 이라면
2016-02-17 11:20
2016-02-17 11:30
'
2016-02-18 11:10
2016-02-18 11:20
이런식으로 조회를 하고 싶은데
즉 oracle connect by level과 같은 무한 로우 생성처럼 될수는 없는가요?
SELECT d + INTERVAL (a*100 + b*10 + c)*10 MINUTE x FROM (SELECT CONCAT( LEFT(DATE_FORMAT(current_timestamp(), '%Y-%m-%d %H:%i'), 15) , '0') - INTERVAL 1 DAY d) d , (SELECT 0 a UNION ALL SELECT 1 ) a , (SELECT 0 b UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 ) b , (SELECT 0 c UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 ) c WHERE (a*100 + b*10 + c) <= 144 ORDER BY x ;
마농님
감사합니다.