-- 년월일
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 679 | ||
| 7629 |
|
10년 전 | 2444 | |
| 7628 | 10년 전 | 820 | ||
| 7627 |
|
10년 전 | 1053 | |
| 7626 |
|
10년 전 | 1807 | |
| 7625 | 10년 전 | 743 | ||
| 7624 | 10년 전 | 751 | ||
| 7623 |
|
10년 전 | 3143 | |
| 7622 | 10년 전 | 755 | ||
| 7621 |
leeleeleelee
|
10년 전 | 609 | |
| 7620 | 10년 전 | 556 | ||
| 7619 | 10년 전 | 527 | ||
| 7618 | 10년 전 | 1061 | ||
| 7617 | 10년 전 | 742 | ||
| 7616 | 10년 전 | 680 | ||
| 7615 | 10년 전 | 745 | ||
| 7614 | 10년 전 | 1289 | ||
| 7613 |
|
10년 전 | 2103 | |
| 7612 | 10년 전 | 1187 | ||
| 7611 | 10년 전 | 1448 | ||
| 7610 |
|
10년 전 | 1926 | |
| 7609 |
|
10년 전 | 1381 | |
| 7608 |
mwdkim
|
10년 전 | 1154 | |
| 7607 |
|
10년 전 | 1084 | |
| 7606 |
mwdkim
|
10년 전 | 3962 | |
| 7605 | 10년 전 | 710 | ||
| 7604 | 10년 전 | 1049 | ||
| 7603 | 10년 전 | 1667 | ||
| 7602 |
|
10년 전 | 1101 | |
| 7601 |
AniNest
|
10년 전 | 2818 | |
| 7600 |
port443
|
10년 전 | 1063 | |
| 7599 | 10년 전 | 968 | ||
| 7598 | 10년 전 | 1043 | ||
| 7597 | 10년 전 | 4591 | ||
| 7596 |
SeungYeon
|
10년 전 | 912 | |
| 7595 |
untitled
|
10년 전 | 2461 | |
| 7594 |
프로그래머7
|
10년 전 | 1750 | |
| 7593 |
untitled
|
10년 전 | 2393 | |
| 7592 |
untitled
|
10년 전 | 1959 | |
| 7591 |
untitled
|
10년 전 | 2697 | |
| 7590 |
아리마2001
|
10년 전 | 877 | |
| 7589 | 10년 전 | 1128 | ||
| 7588 |
|
10년 전 | 2941 | |
| 7587 | 10년 전 | 1325 | ||
| 7586 | 10년 전 | 690 | ||
| 7585 | 10년 전 | 1724 | ||
| 7584 | 10년 전 | 1427 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1194 | |
| 7582 |
|
10년 전 | 1155 | |
| 7581 | 10년 전 | 1384 | ||
| 7580 | 10년 전 | 1036 | ||
| 7579 |
|
10년 전 | 627 | |
| 7578 | 10년 전 | 1446 | ||
| 7577 |
|
10년 전 | 1892 | |
| 7576 | 10년 전 | 1402 | ||
| 7575 |
멋진남자임
|
10년 전 | 1485 | |
| 7574 | 10년 전 | 2150 | ||
| 7573 | 10년 전 | 3288 | ||
| 7572 | 10년 전 | 783 | ||
| 7571 |
|
10년 전 | 798 | |
| 7570 |
|
10년 전 | 1348 | |
| 7569 | 10년 전 | 1568 | ||
| 7568 |
this1mg
|
10년 전 | 1069 | |
| 7567 |
|
10년 전 | 786 | |
| 7566 | 10년 전 | 930 | ||
| 7565 |
Angel하늘
|
10년 전 | 1035 | |
| 7564 |
seoldi
|
10년 전 | 1280 | |
| 7563 |
|
10년 전 | 1420 | |
| 7562 |
멋진남자임
|
10년 전 | 2121 | |
| 7561 | 10년 전 | 744 | ||
| 7560 |
leeleeleelee
|
10년 전 | 934 | |
| 7559 | 10년 전 | 5076 | ||
| 7558 |
RinaP
|
10년 전 | 813 | |
| 7557 |
|
10년 전 | 1272 | |
| 7556 | 10년 전 | 1215 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1685 | |
| 7554 | 10년 전 | 1113 | ||
| 7553 |
senseme
|
10년 전 | 1363 | |
| 7552 |
ehdltdoit
|
10년 전 | 1458 | |
| 7551 |
|
10년 전 | 1846 | |
| 7550 |
leeleeleelee
|
10년 전 | 1618 | |
| 7549 | 10년 전 | 2450 | ||
| 7548 | 10년 전 | 1857 | ||
| 7547 |
멋진남자임
|
10년 전 | 1982 | |
| 7546 | 10년 전 | 1024 | ||
| 7545 |
ILMare1003
|
10년 전 | 1315 | |
| 7544 |
|
10년 전 | 1271 | |
| 7543 | 10년 전 | 905 | ||
| 7542 | 10년 전 | 683 | ||
| 7541 |
울라라라우
|
10년 전 | 886 | |
| 7540 | 10년 전 | 1611 | ||
| 7539 | 10년 전 | 960 | ||
| 7538 |
|
10년 전 | 1848 | |
| 7537 | 10년 전 | 3636 | ||
| 7536 |
Gaumi
|
10년 전 | 1446 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1300 | |
| 7534 |
senseme
|
10년 전 | 1222 | |
| 7533 | 10년 전 | 1224 | ||
| 7532 | 10년 전 | 893 | ||
| 7531 | 10년 전 | 2086 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기