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

writing a sql statement with condition

Featured Replies

بتاريخ:

السلام عليكم ورحمة الله وبركاته

اخوتي في الله احتاج لاستشارتكم...

عندي table فلنفرض اسمه customers يحتوي على ما يلي:
branch_code
Customer_num
customer_name
nationality_code


حيث ال nationality_code هو عبارة عن رقم (1،2،3،....)

اريد ان اكتب sql select statement بحيث تظهر لي جميع المعلومات الموجودة في جدول ال customers ولكن بدل الnationality اكتب palestinian اذا كان الكود هو 1 او others اذا كان الكود غير ذلك (لا يساوي 1)


وشكرا.....

بتاريخ:

استخدم امر decode

select Customer_num , decode (nationality_code, 1 , 'palestinian', 'Others' ) from customers;



select empno , decode (DEPTNO, 10 , 'ArabOracle', 'Others' ) from emp;

EMPNO DECODE(DEP
----- ----------
7369 Others
7499 Others
7521 Others
7566 Others
7654 Others
7698 Others
7782 ArabOracle
7788 Others
7839 ArabOracle
7844 Others
7876 Others

تم تعديل بواسطة Amgad

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

شكرا يا ابو المجد... بارك الله فيك

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

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

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

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

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

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.