개발/ORCLE
오라클 SUBSTR 2번쨰
쭈니후니
2008. 11. 10. 17:25
date_test 컬럼에 값이 20081110 들어있고 date_test2컬럼에는 값이 20081130 들어있다고하자.
Ex)
SELECT
SUBSTR(date_test, 1, 4) || '.'
SUBSTR(date_test, 5, 2) || '.'
SUBSTR(date_test, 7, 2) || '~'
SUBSTR(date_test2, 1, 4) || '.'
SUBSTR(date_test2, 5, 2) || '.'
SUBSTR(date_test2, 7, 2) Date
FROM Test
Ex)
SELECT
SUBSTR(date_test, 1, 4) || '.'
SUBSTR(date_test, 5, 2) || '.'
SUBSTR(date_test, 7, 2) || '~'
SUBSTR(date_test2, 1, 4) || '.'
SUBSTR(date_test2, 5, 2) || '.'
SUBSTR(date_test2, 7, 2) Date
FROM Test
Date
=====================
2008.11.10 ~ 2008.11.30
이런식으로도 할수있다.
2008.11.10 ~ 2008.11.30
이런식으로도 할수있다.