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

Make A Select

Featured Replies

بتاريخ:



Dear all

I have two columns in al table its data is like the following


example :


stuff description

desk is red with glass
desk is rounded
desk having four legs
chair its color is brown




this is how the data in the table

what i want is to select from the column stuff the thing with the different description for it without repeating this stuff


such as the following :

desk is red with glass
is rounded
having four legs


chair its color is brown



Will you help me in that select please as fast as possiple thnks alot



بتاريخ:

السلام عليكم...
هذا الحل ولكن النتائج سوف تظهر على الشكل التالي:

desk
is red with glass
is rounded
having four legs

chair
its color is brown

select Mixed from ( select distinct(stuff) Mixed,stuff,'1' from TableName union
select description,stuff,'2' from TableName order by 2,3)
/
بتاريخ:

اخ تروي مان .. دائما تفاجئني بشي جديد وجميل

ماذا تقصد عندما تعمل order by 2,3
ومافائدة وضع الكولمن الجديد الي فيه القيمة 1و2

بتاريخ:

شكراً لك أخي الكريم,
بالنسبة لعبارة الـ Order by 2,3 يقصد بها بشكل عام الترتيب حسب الحقل الثاني الوارد في تعليمة الاستعلام فإذا تكررت هذه القيمة سيتم الترتيب حسي الحقل الثالث .
لتوضيح عمل التعليمة سنضع نتائج الاجتماع مباشرة كالتالي :

1  select distinct(job) Mixed,job,'1' Num from emp 2  union
 3  select ename,job,'2' from emp 4* order by 2,3
SQL> /
MIXED      JOB       N
---------- --------- -
ANALYST    ANALYST   1
FORD       ANALYST   2
SCOTT      ANALYST   2
CLERK      CLERK     1
ADAMS      CLERK     2
JAMES      CLERK     2
MILLER     CLERK     2
SMITH      CLERK     2
MANAGER    MANAGER   1
BLAKE      MANAGER   2
CLARK      MANAGER   2

MIXED      JOB       N
---------- --------- -
JONES      MANAGER   2
PRESIDENT  PRESIDENT 1
KING       PRESIDENT 2
SALESMAN   SALESMAN  1
ALLEN      SALESMAN  2
MARTIN SALESMAN  2
TURNER     SALESMAN  2
WARD       SALESMAN  2

19 rows selected.



لقد اضطررت إلى وضع الحقل الثالث من أجل ترتيب النتائج ,
فمثلاً بالنسبة للوظيفة ANALYST

ANALYST ANALYST 1
FORD ANALYST 2
SCOTT ANALYST 2

بهذه الحالة استطعت التحكم بوضع اسم الوظيفة في مقدمة أسماء الموظفين التابعين لها .
وسيتم الترتيب على حسب اسم الوظيفة فإذا تشابهت مع أحد الحقول الأخرى
ANALYST ANALYST 1
سيتم الترتيب حسب الحقل الثالث و هو الحقل الرقمي و بذلك أضمن توضع اسم الوظيفة في أول قائمة الموظفين .

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

بتاريخ:

شكرا وبارك الله فيك <_<

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

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

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

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

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

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.