Notice
Recent Posts
Recent Comments
SNOWFLAKES DRAWING PAPER
[Oracle] 오라클 -> MySQL로 전환 본문
1. to_number() ---> cast()
ex) to_number(holiday_mon) --> cast( holiday_mon AS signed )
2. to_char(sysdate,'yyyymmdd')
=> CAST( DATE_FORMAT( now( ) , '%Y%m%d' ) AS CHAR )
3. 년월일시분초
=> CAST( DATE_FORMAT( now( ) , '%Y%m%d%H%i%s' ) AS CHAR )
4. rownum
=>
SELECT @rownum:=@rownum+1 rownum, t.*
FROM (SELECT @rownum:=0) r, mytable t;
5. to_char(balance,'999,999,999,999')
=> format(balance,0)
6. decode
=> case prog_gb_cd
when 1 then '접수'
when 2 then '처리중'
when 3 then '완료'
else '미접수'
end
FROM (SELECT @rownum:=0) r, mytable t;
5. to_char(balance,'999,999,999,999')
=> format(balance,0)
6. decode
=> case prog_gb_cd
when 1 then '접수'
when 2 then '처리중'
when 3 then '완료'
else '미접수'
end
4. to_char(컬럼, '0000000')
=> LPAD(컬럼,7,'0')
'개발 > Oracle/SQL/ERD' 카테고리의 다른 글
DB 클라이언트 툴 (0) | 2014.09.30 |
---|---|
[Oracle] 자동증가 Sequence (0) | 2011.10.06 |
[Oracle] 오라클 dump export (0) | 2011.10.05 |
[SQL] MySQL case when (0) | 2009.04.19 |
[SQL] MySQL 저장 프로시져, 저장 함수, 트리거 예제 모음 1 (0) | 2009.04.19 |
Comments