-- 년월일
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8030 | 9년 전 | 416 | ||
| 8029 | 9년 전 | 339 | ||
| 8028 | 9년 전 | 296 | ||
| 8027 | 9년 전 | 308 | ||
| 8026 | 9년 전 | 381 | ||
| 8025 | 9년 전 | 410 | ||
| 8024 | 9년 전 | 400 | ||
| 8023 | 9년 전 | 424 | ||
| 8022 | 9년 전 | 340 | ||
| 8021 | 9년 전 | 362 | ||
| 8020 | 9년 전 | 365 | ||
| 8019 | 9년 전 | 378 | ||
| 8018 | 9년 전 | 480 | ||
| 8017 | 9년 전 | 561 | ||
| 8016 | 9년 전 | 387 | ||
| 8015 | 9년 전 | 419 | ||
| 8014 | 9년 전 | 347 | ||
| 8013 | 9년 전 | 269 | ||
| 8012 | 9년 전 | 270 | ||
| 8011 | 9년 전 | 478 | ||
| 8010 | 9년 전 | 333 | ||
| 8009 | 9년 전 | 349 | ||
| 8008 | 9년 전 | 318 | ||
| 8007 | 9년 전 | 466 | ||
| 8006 | 9년 전 | 502 | ||
| 8005 |
|
9년 전 | 997 | |
| 8004 | 9년 전 | 386 | ||
| 8003 | 9년 전 | 456 | ||
| 8002 | 9년 전 | 350 | ||
| 8001 |
|
9년 전 | 693 | |
| 8000 | 9년 전 | 458 | ||
| 7999 | 9년 전 | 408 | ||
| 7998 | 9년 전 | 467 | ||
| 7997 | 9년 전 | 337 | ||
| 7996 | 9년 전 | 565 | ||
| 7995 | 9년 전 | 514 | ||
| 7994 | 9년 전 | 402 | ||
| 7993 | 9년 전 | 474 | ||
| 7992 | 9년 전 | 543 | ||
| 7991 | 9년 전 | 291 | ||
| 7990 | 9년 전 | 327 | ||
| 7989 | 9년 전 | 332 | ||
| 7988 | 9년 전 | 760 | ||
| 7987 | 9년 전 | 464 | ||
| 7986 | 9년 전 | 465 | ||
| 7985 | 9년 전 | 544 | ||
| 7984 | 9년 전 | 462 | ||
| 7983 | 9년 전 | 699 | ||
| 7982 | 9년 전 | 559 | ||
| 7981 | 9년 전 | 517 | ||
| 7980 | 9년 전 | 539 | ||
| 7979 | 9년 전 | 528 | ||
| 7978 | 9년 전 | 491 | ||
| 7977 | 9년 전 | 433 | ||
| 7976 | 9년 전 | 893 | ||
| 7975 | 9년 전 | 407 | ||
| 7974 | 9년 전 | 451 | ||
| 7973 | 9년 전 | 632 | ||
| 7972 | 9년 전 | 424 | ||
| 7971 | 9년 전 | 499 | ||
| 7970 | 9년 전 | 342 | ||
| 7969 | 9년 전 | 582 | ||
| 7968 | 9년 전 | 430 | ||
| 7967 | 9년 전 | 413 | ||
| 7966 | 9년 전 | 417 | ||
| 7965 |
|
9년 전 | 1046 | |
| 7964 | 9년 전 | 436 | ||
| 7963 | 9년 전 | 446 | ||
| 7962 | 9년 전 | 445 | ||
| 7961 |
전갈자리남자
|
9년 전 | 539 | |
| 7960 | 9년 전 | 1007 | ||
| 7959 | 9년 전 | 586 | ||
| 7958 | 9년 전 | 436 | ||
| 7957 | 9년 전 | 394 | ||
| 7956 | 9년 전 | 391 | ||
| 7955 | 9년 전 | 495 | ||
| 7954 | 9년 전 | 431 | ||
| 7953 | 9년 전 | 479 | ||
| 7952 | 9년 전 | 400 | ||
| 7951 | 9년 전 | 531 | ||
| 7950 | 9년 전 | 430 | ||
| 7949 | 9년 전 | 422 | ||
| 7948 | 9년 전 | 356 | ||
| 7947 | 9년 전 | 974 | ||
| 7946 | 9년 전 | 492 | ||
| 7945 | 9년 전 | 434 | ||
| 7944 | 9년 전 | 495 | ||
| 7943 | 9년 전 | 425 | ||
| 7942 | 9년 전 | 440 | ||
| 7941 | 9년 전 | 429 | ||
| 7940 | 9년 전 | 929 | ||
| 7939 | 9년 전 | 422 | ||
| 7938 | 9년 전 | 437 | ||
| 7937 | 9년 전 | 326 | ||
| 7936 | 9년 전 | 909 | ||
| 7935 | 9년 전 | 515 | ||
| 7934 | 9년 전 | 498 | ||
| 7933 | 9년 전 | 622 | ||
| 7932 | 9년 전 | 562 | ||
| 7931 | 9년 전 | 620 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기