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

ارجو المساعده في جملة Sql

Featured Replies

بتاريخ:

ياجماعة بدي مساعة في جملة
sql

Titles.
titleno title
20 mathmatic


titleauths
titleno authno
20 1
20 2
20 3


authors
authno name
1 Khaled
2 Amer
3 tariq

Select title,name from titles,titleauths,authors
Where titles.titleno=titleauths.titleno and
Titleauths.authno=authors.authno;

النتيجة

Mathmatic khaled
Mathmatic amer
Mathmatic tariq

ولكني بدي جملة النتيجة كالاتي

Mathmatic \ khaled ; amer; tariq

وليس كل حقل في سطر

بتاريخ:

السلام عليكم ورحمة الله وبركاته
اخي فالله
بعد التحية
اتمني ان تجد ضالتك فهذه السطور المتواضعه

CREATE OR REPLACE FUNCTION get_name_auth
  RETURN CHAR
IS
  x   VARCHAR2 (1000);
BEGIN FOR i IN (SELECT title, NAME
              FROM titles, titleauths, authors
             WHERE titles.titleno = titleauths.titleno AND titleauths.authno = authors.authno)
  LOOP
     IF x IS NULL
     THEN
        x := i.title || ' \ ' || i.NAME;
     ELSE
        x := x || ' ; ' || i.NAME;
     END IF;
  END LOOP;

  RETURN x;
END;

SELECT get_name_auth  FROM DUAL



وفقك الله الى ماتحب ويرضي

بتاريخ:

بامكانك ايضا ان تقوم بعملها باستخدام SQL


select p.title, substr(max(substr(sys_connect_by_path (p.name,'; '),2)),1,60)
from (select title,
                    name,
                    row_number() over (partition by title order by title, name) rn
               from (Select title,name from titles,titleauths,authors Where titles.titleno=titleauths.titleno and Titleauths.authno=authors.authno) x ) p
               
               start with p.rn = 1
 connect by p.rn = prior p.rn + 1 and prior p.title = p.title
   group by title;



أول لتخفيف الكود بامكانك عمل view من الاستعلام المستخدم من قبلك
كالتالي

create view title1 as Select title,name from titles,titleauths,authors Where titles.titleno=titleauths.titleno and Titleauths.authno=authors.authno;


لتصبح جملة الاستعلام كالتالي

select p.title, substr(max(substr(sys_connect_by_path (p.name,'; '),2)),1,60)
from (select title,
                    name,
                    row_number() over (partition by title order by title, name) rn
               from title1) p
               
               start with p.rn = 1
 connect by p.rn = prior p.rn + 1 and prior p.title = p.title
   group by title;


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

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

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

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

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

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.