بتاريخ: 27 فبراير 201313 سنة comment_233081 [color=#00008B][size=4][background=transparent]select[/background][/size][/color][color=#000000][size=4][background=transparent] trunc[/background][/size][/color][color=#000000][size=4][background=transparent]([/background][/size][/color][color=#000000][size=4][background=transparent]sysdate[/background][/size][/color][color=#000000][size=4][background=transparent],[/background][/size][/color][color=#000000][size=4][background=transparent] [/background][/size][/color][color=#800000][size=4][background=transparent]'YEAR'[/background][/size][/color][color=#000000][size=4][background=transparent])[/background][/size][/color][color=#000000][size=4][background=transparent] begin_year [/background][/size][/color][color=#000000][size=4][background=transparent],[/background][/size][/color][color=#000000][size=4][background=transparent] add_months[/background][/size][/color][color=#000000][size=4][background=transparent]([/background][/size][/color][color=#000000][size=4][background=transparent]trunc[/background][/size][/color][color=#000000][size=4][background=transparent]([/background][/size][/color][color=#000000][size=4][background=transparent]sysdate[/background][/size][/color][color=#000000][size=4][background=transparent],[/background][/size][/color][color=#000000][size=4][background=transparent] [/background][/size][/color][color=#800000][size=4][background=transparent]'YEAR'[/background][/size][/color][color=#000000][size=4][background=transparent]),[/background][/size][/color][color=#000000][size=4][background=transparent] [/background][/size][/color][color=#800000][size=4][background=transparent]12[/background][/size][/color][color=#000000][size=4][background=transparent])[/background][/size][/color][color=#800000][size=4][background=transparent]-1[/background][/size][/color][color=#000000][size=4][background=transparent]/[/background][/size][/color][color=#800000][size=4][background=transparent]24[/background][/size][/color][color=#000000][size=4][background=transparent]/[/background][/size][/color][color=#800000][size=4][background=transparent]60[/background][/size][/color][color=#000000][size=4][background=transparent]/[/background][/size][/color][color=#800000][size=4][background=transparent]60[/background][/size][/color][color=#000000][size=4][background=transparent] last_second_year[/background][/size][/color] [color=#00008B][size=4][background=transparent]from[/background][/size][/color][color=#000000][size=4][background=transparent] dual[/background][/size][/color][color=#000000][size=4][background=transparent];[/background][/size][/color] تقديم بلاغ
بتاريخ: 2 مارس 201313 سنة comment_233144 مع تعديل بسيط لتصبح أبسط SELECT TRUNC (SYSDATE, 'yy') begin_year, TRUNC (ADD_MONTHS (SYSDATE, 12), 'yy') - 1 last_second_year FROM DUAL تقديم بلاغ
بتاريخ: 2 مارس 201313 سنة comment_233175 SELECT round(sysdate,'YYYY') ffff ,add_months(trunc(sysdate,'YYYY')-1,12) dddd from dual; تقديم بلاغ
بتاريخ: 9 مارس 201313 سنة comment_233396 First day of current week(sunday) select TRUNC(SYSDATE, 'Day') from dual;--First day of next week(sunday)select TRUNC(SYSDATE+7 , 'Day') from dual;--First day of previous week(sunday)select TRUNC(SYSDATE-7 , 'Day') from dual;--First day of current monthselect TRUNC(SYSDATE , 'Month') from dual;--First day of previous monthselect TRUNC(TRUNC(SYSDATE , 'Month')-1 , 'Month') from dual;--First day of next monthselect TRUNC(LAST_DAY(SYSDATE)+1 , 'Month') from dual;--First day of current yearselect TRUNC(SYSDATE , 'Year') from dual;--First day of previous yearselect TRUNC(TRUNC(SYSDATE , 'Year')-1 , 'Year') from dual;--First day of next yearselect ADD_MONTHS(TRUNC(SYSDATE , 'Year'),12) from dual;-- First Day of Current quater select TRUNC(SYSDATE , 'Q') from dual;-- First Day of Previous Quarterselect ADD_MONTHS(TRUNC(SYSDATE , 'Q'),-3) from dual;-- First Day of Next Quarterselect ADD_MONTHS(TRUNC(SYSDATE , 'Q'),3) from dual;--Last day of current week(sunday)select TRUNC(SYSDATE, 'Day')+6 from dual;--Last day of next week(sunday)select TRUNC(SYSDATE+7 , 'Day')+6 from dual;--Last day of previous week(sunday)select TRUNC(SYSDATE-7 , 'Day')+6 from dual;--Last day of current monthselect LAST_DAY(TRUNC(SYSDATE , 'Month')) from dual;--Last day of previous monthselect LAST_DAY(TRUNC(TRUNC(SYSDATE , 'Month')-1 , 'Month')) from dual;--Last day of next monthselect LAST_DAY(TRUNC(LAST_DAY(SYSDATE)+1 , 'Month')) from dual;--Last day of current yearselect LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE , 'Year'),11)) from dual;--Last day of previous yearselect LAST_DAY(ADD_MONTHS(TRUNC(TRUNC(SYSDATE , 'Year')-1 , 'Year'),11)) from dual;--Last day of next yearselect LAST_DAY(ADD_MONTHS(TRUNC(TRUNC(SYSDATE , 'Year')-1 , 'Year'),-13)) from dual;-- Last Day of Current quater select LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE , 'Q'),2)) from dual;-- Last Day of Previous Quarterselect TRUNC(SYSDATE , 'Q')-1 from dual;-- Last Day of Next Quarterselect LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE , 'Q'),5)) from dual; تم تعديل 9 مارس 201313 سنة بواسطة ahmed.arafa تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.