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

?to_char

Featured Replies

بتاريخ:

Question


Examine the structure of the INVOICE table


Name Null Type
------ --------- -------
INV_NO NOT NULL NUMBER(3)
INV_DATE DATE
INV_AMT NUMBER(10,2
(

Which two SQL statements would execute successfully? (Choose two

 

SELECT inv_no,NVL2(inv_date,'Pending','Incomplete')
FROM invoice;

SELECT inv_no,NVL2(inv_amt,inv_date,'Not Available')
FROM invoice;

SELECT inv_no,NVL2(inv_date,sysdate-inv_date,sysdate)
FROM invoice;

SELECT inv_no,NVL2(inv_amt,inv_amt*.25,'Not Available') FROM invoice;

لماذا الاجابة الاولية صحيحـة

 

مو المفروض نستعمل To_char

:(  :wacko:  

 

 

كيف صارت صحيحة واحنا بنحط كاركتر في خانة الديت

تم تعديل بواسطة Ahmad.Hasan

بتاريخ:

Answer 2 and 4 are wrong because NVL2 function has 3 parameters , parameter 2 and 3 should be same datatype and no relation between they datatype with first parameter datatype.

 

if you checked answer 1 and 4, you will find:

Answer 1: parameter 2,3 are same datatype = Characters.

Answer 3: parameter 2,3 are same datatype = Date..

 

Hope it's clear for you now :)

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

ولاكن الnvl2

 

يوجد به 3 parameters

 

اول parameter  عمود من الجدول اذا كان null يرجع الاول واذا كان not null يرجع الثاني 

 

 

والعمود اللي احنا عاملين فيه الnvl2 هو عمود number  data type 

 

كيف يقبل يرجع كاركتر 

 

لازم نحولة الى To_CHAR

 

 

:wacko:

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

هل تقصد بإنه لاعلاقة بنوع data type في الparameter  الاول  وبين نوع الdata typ

 

 في الparameter  الثاني والثالث

 

 

ولاكن يجب ان يتشابه في الثاني والثالث ؟

 

 

 

ولاكن في الnvl لازم نحول الداتا تايب مثلا

 

 

  commission_pct   number

 

 

 

select last_name, job_id, nvl(commission_pct,'no comm') from employees

 

 

 

بيطلع ايرور ولاكن في الnvl2 مابيطلع ادا لم نحوله 

 

 

هل تختلف القوانين مابين الnvl و ال nvl2 وال nullif وال coalesce ?

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

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

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

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

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

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.