الانتقال إلى المحتوى
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.

كيف استخرج اكبر رقم بدون استخدام دالة max

Featured Replies

بتاريخ:

الله لايمسيكم الا بالخير

اخواني الاوراكليون

انا قدر الله علي وغبت محاضر وحيده وكانت هالمحاضره مفتاح كل حاجه

طبعا الدكتور عطانا واجب يقول انشئ جدول فيه عمود واحد فقط اسمه id

ادخل 50 رقم وطلع لي اكبر رقم بدون استخدام دالة max

يجب استخدام while loop

طبعا الكود تكتبون كذا

declare

begin

end


وخالص شكري وتقديري وامتناني لكم مقدماً

اخوكم المجازف

بتاريخ:

السلام عليكم...
هذه بعض الحلول,أعتقد أن الحل الثالث يفي بالغرض....بالتوفيق

declare
Pmax number:=0;
Pmin number:=0;
cursor cur is select ID from test; begin for rec in cur loop
if rec.ID>Pmax then Pmax:=rec.ID;end if;
if rec.ID <Pmin then Pmin:=rec.ID;end if;
end loop;
dbms_output.put_line(Pmax);
dbms_output.put_line(Pmin);
end;
/



declare
Pmax number:=0;
cursor cur is select ID from test order by ID desc;
begin open cur;
fetch cur into Pmax; close cur;
dbms_output.put_line(Pmax);
end;
/



declare
Pmax number:=0;
Pcurrent number:=0;
cursor cur is select ID from test; begin open cur;
fetch cur into Pcurrent; while cur%found loop
if Pcurrent>Pmax then Pmax:=Pcurrent;end if;
fetch cur into Pcurrent; end loop;
close cur;
dbms_output.put_line(Pmax);
end;
/
بتاريخ:
  • كاتب الموضوع

;)

 

 

بيض الله وجهك

 

فكيت عني ازمة

 

الله يفرج عنك كروب الدنيا

بتاريخ:

السلام عليكم...
لقد لا حظت أن هناك خطأ في الحل الأول لأن عملية المقارنة لأول مرة يجب أن تتم مع أحد نتائج الكيرسر و ليس مع الصفر لذلك يصبح الحل:

declare
Pmax number:=0;
Pmin number:=0;
f boolean:=false;
cursor cur is select ID from test; begin for rec in cur loop
if not f then Pmax:=rec.ID;Pmin:=rec.ID;f:=true; end if;
if rec.ID>Pmax then Pmax:=rec.ID;end if;
if rec.ID<Pmin then Pmin:=rec.ID;end if;
end loop;
dbms_output.put_line(Pmax);
dbms_output.put_line(Pmin);
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.