-- 년월일
DECLARE
d1 DATE;
d2 DATE;
years NUMBER;
months NUMBER;
days NUMBER;
BEGIN
d1 := to_date( '09-JUL-2007', 'DD-MON-YYYY' );
d2 := to_date( '24-JUL-1995', 'DD-MON-YYYY' );
years := trunc( months_between( d1, d2 ) / 12 );
months := mod( trunc( months_between( d1, d2 ) ), 12 );
days := d1 - add_months(d2,trunc( months_between( d1, d2 ) ));
dbms_output.put_line( 'years = ' || years);
dbms_output.put_line( 'months = ' || months);
dbms_output.put_line( 'days = ' || days);
END;
/
<결과>
years = 11
months = 11
days = 15
-- 년월일시분초
DECLARE
d1 DATE;
d2 DATE;
years NUMBER;
months NUMBER;
days NUMBER;
hours NUMBER;
minutes NUMBER;
seconds NUMBER;
BEGIN
d1 := to_date( '09-JUL-2007 23:10:43', 'DD-MON-YYYY HH24:MI:SS' );
d2 := to_date( '24-JUL-1995 10:09:40', 'DD-MON-YYYY HH24:MI:SS' );
years := trunc( months_between( d1, d2 ) / 12 );
months := mod( trunc( months_between( d1, d2 ) ), 12 );
days := trunc(d1 - add_months(d2,trunc( months_between( d1, d2 ) )));
hours := trunc( mod( (d1-d2)*24, 24 ) );
minutes := trunc( mod( (d1-d2)*24*60, 60 ) );
seconds := trunc( mod( (d1-d2)*24*60*60, 60 ) );
dbms_output.put_line( 'years = ' || years);
dbms_output.put_line( 'months = ' || months);
dbms_output.put_line( 'days = ' || days);
dbms_output.put_line( 'hours = ' || hours);
dbms_output.put_line( 'minutes = ' || minutes);
dbms_output.put_line( 'seconds = ' || seconds);
END;
/
<결과>
years = 11
months = 11
days = 15
hours = 13
minutes = 1
seconds = 3
DECLARE
d1 DATE;
d2 DATE;
years NUMBER;
months NUMBER;
days NUMBER;
BEGIN
d1 := to_date( '09-JUL-2007', 'DD-MON-YYYY' );
d2 := to_date( '24-JUL-1995', 'DD-MON-YYYY' );
years := trunc( months_between( d1, d2 ) / 12 );
months := mod( trunc( months_between( d1, d2 ) ), 12 );
days := d1 - add_months(d2,trunc( months_between( d1, d2 ) ));
dbms_output.put_line( 'years = ' || years);
dbms_output.put_line( 'months = ' || months);
dbms_output.put_line( 'days = ' || days);
END;
/
<결과>
years = 11
months = 11
days = 15
-- 년월일시분초
DECLARE
d1 DATE;
d2 DATE;
years NUMBER;
months NUMBER;
days NUMBER;
hours NUMBER;
minutes NUMBER;
seconds NUMBER;
BEGIN
d1 := to_date( '09-JUL-2007 23:10:43', 'DD-MON-YYYY HH24:MI:SS' );
d2 := to_date( '24-JUL-1995 10:09:40', 'DD-MON-YYYY HH24:MI:SS' );
years := trunc( months_between( d1, d2 ) / 12 );
months := mod( trunc( months_between( d1, d2 ) ), 12 );
days := trunc(d1 - add_months(d2,trunc( months_between( d1, d2 ) )));
hours := trunc( mod( (d1-d2)*24, 24 ) );
minutes := trunc( mod( (d1-d2)*24*60, 60 ) );
seconds := trunc( mod( (d1-d2)*24*60*60, 60 ) );
dbms_output.put_line( 'years = ' || years);
dbms_output.put_line( 'months = ' || months);
dbms_output.put_line( 'days = ' || days);
dbms_output.put_line( 'hours = ' || hours);
dbms_output.put_line( 'minutes = ' || minutes);
dbms_output.put_line( 'seconds = ' || seconds);
END;
/
<결과>
years = 11
months = 11
days = 15
hours = 13
minutes = 1
seconds = 3
[이 게시물은 관리자님에 의해 2011-10-31 16:47:36 Oracle에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 194 | ||
| 8229 | 9년 전 | 175 | ||
| 8228 |
커네드커네드
|
9년 전 | 215 | |
| 8227 | 9년 전 | 253 | ||
| 8226 | 9년 전 | 275 | ||
| 8225 | 9년 전 | 258 | ||
| 8224 | 9년 전 | 262 | ||
| 8223 | 9년 전 | 241 | ||
| 8222 |
|
9년 전 | 302 | |
| 8221 | 9년 전 | 199 | ||
| 8220 | 9년 전 | 242 | ||
| 8219 | 9년 전 | 218 | ||
| 8218 | 9년 전 | 260 | ||
| 8217 |
star3840
|
9년 전 | 218 | |
| 8216 | 9년 전 | 293 | ||
| 8215 | 9년 전 | 241 | ||
| 8214 | 9년 전 | 344 | ||
| 8213 | 9년 전 | 305 | ||
| 8212 | 9년 전 | 218 | ||
| 8211 | 9년 전 | 388 | ||
| 8210 | 9년 전 | 383 | ||
| 8209 | 9년 전 | 464 | ||
| 8208 | 9년 전 | 345 | ||
| 8207 | 9년 전 | 360 | ||
| 8206 |
|
9년 전 | 307 | |
| 8205 | 9년 전 | 280 | ||
| 8204 | 9년 전 | 269 | ||
| 8203 | 9년 전 | 347 | ||
| 8202 | 9년 전 | 254 | ||
| 8201 | 9년 전 | 298 | ||
| 8200 | 9년 전 | 302 | ||
| 8199 | 9년 전 | 326 | ||
| 8198 | 9년 전 | 288 | ||
| 8197 | 9년 전 | 282 | ||
| 8196 | 9년 전 | 704 | ||
| 8195 | 9년 전 | 289 | ||
| 8194 | 9년 전 | 397 | ||
| 8193 | 9년 전 | 313 | ||
| 8192 | 9년 전 | 313 | ||
| 8191 | 9년 전 | 277 | ||
| 8190 | 9년 전 | 258 | ||
| 8189 | 9년 전 | 321 | ||
| 8188 | 9년 전 | 253 | ||
| 8187 | 9년 전 | 270 | ||
| 8186 | 9년 전 | 270 | ||
| 8185 | 9년 전 | 438 | ||
| 8184 | 9년 전 | 221 | ||
| 8183 | 9년 전 | 427 | ||
| 8182 | 9년 전 | 298 | ||
| 8181 | 9년 전 | 249 | ||
| 8180 | 9년 전 | 826 | ||
| 8179 | 9년 전 | 604 | ||
| 8178 | 9년 전 | 462 | ||
| 8177 |
kiplayer
|
9년 전 | 458 | |
| 8176 | 9년 전 | 494 | ||
| 8175 | 9년 전 | 376 | ||
| 8174 | 9년 전 | 371 | ||
| 8173 | 9년 전 | 458 | ||
| 8172 | 9년 전 | 340 | ||
| 8171 | 9년 전 | 304 | ||
| 8170 | 9년 전 | 420 | ||
| 8169 |
커네드커네드
|
9년 전 | 370 | |
| 8168 | 9년 전 | 457 | ||
| 8167 | 9년 전 | 447 | ||
| 8166 | 9년 전 | 347 | ||
| 8165 | 9년 전 | 285 | ||
| 8164 | 9년 전 | 417 | ||
| 8163 | 9년 전 | 420 | ||
| 8162 | 9년 전 | 403 | ||
| 8161 | 9년 전 | 422 | ||
| 8160 |
|
9년 전 | 640 | |
| 8159 | 9년 전 | 586 | ||
| 8158 | 9년 전 | 383 | ||
| 8157 | 9년 전 | 506 | ||
| 8156 | 9년 전 | 376 | ||
| 8155 | 9년 전 | 388 | ||
| 8154 |
00년생용띠
|
9년 전 | 709 | |
| 8153 | 9년 전 | 350 | ||
| 8152 |
|
9년 전 | 526 | |
| 8151 | 9년 전 | 520 | ||
| 8150 | 9년 전 | 637 | ||
| 8149 |
Jangfolk
|
9년 전 | 497 | |
| 8148 | 9년 전 | 310 | ||
| 8147 | 9년 전 | 495 | ||
| 8146 | 9년 전 | 576 | ||
| 8145 | 9년 전 | 535 | ||
| 8144 | 9년 전 | 503 | ||
| 8143 | 9년 전 | 327 | ||
| 8142 | 9년 전 | 548 | ||
| 8141 | 9년 전 | 488 | ||
| 8140 | 9년 전 | 1062 | ||
| 8139 | 9년 전 | 397 | ||
| 8138 |
전갈자리남자
|
9년 전 | 507 | |
| 8137 | 9년 전 | 547 | ||
| 8136 | 9년 전 | 873 | ||
| 8135 |
|
9년 전 | 922 | |
| 8134 |
PlayPixel
|
9년 전 | 663 | |
| 8133 |
|
9년 전 | 562 | |
| 8132 | 9년 전 | 593 | ||
| 8131 | 9년 전 | 953 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기