-- 년월일
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 2830 | 15년 전 | 986 | ||
| 2829 | 15년 전 | 688 | ||
| 2828 | 15년 전 | 727 | ||
| 2827 | 15년 전 | 654 | ||
| 2826 | 15년 전 | 855 | ||
| 2825 |
|
15년 전 | 669 | |
| 2824 | 15년 전 | 800 | ||
| 2823 | 15년 전 | 738 | ||
| 2822 | 15년 전 | 1016 | ||
| 2821 | 15년 전 | 649 | ||
| 2820 | 15년 전 | 840 | ||
| 2819 | 15년 전 | 769 | ||
| 2818 | 15년 전 | 1097 | ||
| 2817 |
Lemios
|
15년 전 | 1322 | |
| 2816 | 15년 전 | 753 | ||
| 2815 | 15년 전 | 869 | ||
| 2814 | 15년 전 | 759 | ||
| 2813 |
|
15년 전 | 909 | |
| 2812 | 15년 전 | 763 | ||
| 2811 |
|
15년 전 | 937 | |
| 2810 | 15년 전 | 829 | ||
| 2809 | 15년 전 | 841 | ||
| 2808 |
|
15년 전 | 760 | |
| 2807 | 15년 전 | 3719 | ||
| 2806 | 15년 전 | 6812 | ||
| 2805 | 15년 전 | 942 | ||
| 2804 |
MKCstrong
|
15년 전 | 730 | |
| 2803 | 15년 전 | 1086 | ||
| 2802 | 15년 전 | 892 | ||
| 2801 | 15년 전 | 930 | ||
| 2800 | 15년 전 | 794 | ||
| 2799 | 15년 전 | 685 | ||
| 2798 | 15년 전 | 1119 | ||
| 2797 |
|
15년 전 | 760 | |
| 2796 | 15년 전 | 1317 | ||
| 2795 |
|
15년 전 | 1095 | |
| 2794 | 15년 전 | 917 | ||
| 2793 | 15년 전 | 874 | ||
| 2792 |
|
15년 전 | 736 | |
| 2791 | 15년 전 | 1062 | ||
| 2790 | 15년 전 | 766 | ||
| 2789 |
진정한승리
|
15년 전 | 2862 | |
| 2788 | 15년 전 | 1074 | ||
| 2787 | 15년 전 | 996 | ||
| 2786 | 15년 전 | 1137 | ||
| 2785 | 15년 전 | 739 | ||
| 2784 | 15년 전 | 1010 | ||
| 2783 | 15년 전 | 1208 | ||
| 2782 | 15년 전 | 882 | ||
| 2781 | 15년 전 | 1649 | ||
| 2780 | 15년 전 | 679 | ||
| 2779 |
|
15년 전 | 858 | |
| 2778 | 15년 전 | 1168 | ||
| 2777 |
|
15년 전 | 930 | |
| 2776 | 15년 전 | 665 | ||
| 2775 |
|
15년 전 | 2904 | |
| 2774 |
|
15년 전 | 1073 | |
| 2773 |
|
15년 전 | 2067 | |
| 2772 | 15년 전 | 1950 | ||
| 2771 | 15년 전 | 1013 | ||
| 2770 |
RedRiverFisher
|
15년 전 | 2249 | |
| 2769 | 15년 전 | 815 | ||
| 2768 | 15년 전 | 1342 | ||
| 2767 | 15년 전 | 2534 | ||
| 2766 |
용다섯마리
|
15년 전 | 798 | |
| 2765 | 15년 전 | 1327 | ||
| 2764 | 15년 전 | 1543 | ||
| 2763 | 15년 전 | 910 | ||
| 2762 | 15년 전 | 1223 | ||
| 2761 | 15년 전 | 765 | ||
| 2760 |
|
15년 전 | 2001 | |
| 2759 | 15년 전 | 1397 | ||
| 2758 | 15년 전 | 879 | ||
| 2757 | 15년 전 | 563 | ||
| 2756 | 15년 전 | 670 | ||
| 2755 |
|
15년 전 | 1109 | |
| 2754 | 15년 전 | 1180 | ||
| 2753 | 15년 전 | 599 | ||
| 2752 | 15년 전 | 495 | ||
| 2751 | 15년 전 | 751 | ||
| 2750 | 15년 전 | 697 | ||
| 2749 |
원시인교주
|
15년 전 | 1719 | |
| 2748 | 15년 전 | 568 | ||
| 2747 | 15년 전 | 637 | ||
| 2746 | 15년 전 | 608 | ||
| 2745 | 15년 전 | 866 | ||
| 2744 |
원시인교주
|
15년 전 | 1701 | |
| 2743 | 15년 전 | 1641 | ||
| 2742 |
원시인교주
|
15년 전 | 14076 | |
| 2741 |
원시인교주
|
15년 전 | 3178 | |
| 2740 |
|
15년 전 | 741 | |
| 2739 | 15년 전 | 662 | ||
| 2738 | 15년 전 | 794 | ||
| 2737 | 15년 전 | 688 | ||
| 2736 | 15년 전 | 699 | ||
| 2735 | 15년 전 | 11335 | ||
| 2734 | 15년 전 | 1189 | ||
| 2733 | 15년 전 | 1045 | ||
| 2732 | 15년 전 | 1388 | ||
| 2731 | 15년 전 | 1325 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기