الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Function لحساب العمر

Featured Replies

بتاريخ:

للي عاوز
Function لحساب العمر
انا عملتها معقدة شوية بس شغالة

create or replace function how_old (p_date varchar)
return varchar 
is 
birth_day timestamp(2) := to_date(p_date,'DD-MON-YYYY ');
today timestamp(2) := sysdate;
age varchar2(100);
begin age :='You are ' || to_char
(trunc(
(extract(
day from (today-birth_day))/30.4375)/12)
) 
|| ' years and ' || 
to_char(
trunc(
(mod(
(extract(
day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375))
|| ' months and ' || 
to_char(
trunc(mod
((
mod(
(
extract(day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375))
|| ' days and ' || 
to_char(
to_char(
round(
mod(
mod(
(mod(
(extract(
day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375,1)*24,5))+  
(extract(
hour from (today-birth_day))) || ' hours and ' ||
to_char
(extract(
minute from (today-birth_day)))) || ' minutes.';
return age;
end;



Select HOW_OLD('12-jan-1982') from dual

Have fun

بتاريخ:
  • كاتب الموضوع

create or replace function how_old (p_date varchar)
return varchar 
is 
birth_day timestamp(2) := to_date(p_date,'DD-MON-YYYY ');
today timestamp(2) := sysdate;
age varchar2(100);
begin age :='You are ' || to_char
(trunc(
(extract(
day from (today-birth_day))/30.4375)/12)
) 
|| ' years and ' || 
to_char(
trunc(
(mod(
(extract(
day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375))
|| ' months and ' || 
to_char(
trunc(mod
((
mod(
(
extract(day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375))
|| ' days and ' || 
to_char(
to_char(
round(
mod(
mod(
(mod(
(extract(
day from (today-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375,1)*24,5))+  
(extract(
hour from (today-birth_day))) || ' hours and ' ||
to_char
(extract(
minute from (today-birth_day)))) || ' minutes.';
return age;
end;

بتاريخ:
  • كاتب الموضوع

create or replace function how_old (p_date varchar)
return varchar
is
birth_day timestamp(2) := to_date(p_date,'DD-MON-YYYY ');
today timestamp(2) := sysdate;
age varchar2(100);
begin age :='You are ' || to_char
(trunc(
(extract(
day from (sysdate-birth_day))/30.4375)/12)
)
|| ' years and ' ||
to_char(
trunc(
(mod(
(extract(
day from (sysdate-birth_day))/30.4375)/12,1)*
365.25)/30.4375))
|| ' months and ' ||
to_char(
trunc(mod
((
mod(
(
extract(day from (sysdate-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375))
|| ' days and ' ||
to_char(
to_char(
round(
mod(
mod(
(mod(
(extract(
day from (sysdate-birth_day))/30.4375)/12,1)*
365.25)/30.4375,1)*30.4375,1)*24,5))+
(extract(
hour from (sysdate-birth_day))) || ' hours and ' ||
to_char
(extract(
minute from (sysdate-birth_day)))) || ' minutes.';
return age;
end;

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.