the past بتاريخ: 5 ديسمبر 2006 تقديم بلاغ مشاركة بتاريخ: 5 ديسمبر 2006 I want to askn about join and non equal please can u expline me that اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
-=|mOOdY|=- بتاريخ: 15 ديسمبر 2006 تقديم بلاغ مشاركة بتاريخ: 15 ديسمبر 2006 (معدل) Simple Join select col1,tab1.col2,col3 from tab1,tab2where tab1.col2=tab2.col2 This is the most common type of join. It returns rows from two tables based on an equality condition, therefore it is also called an equi-join.Non-Equi Joinselect tab1.col1,tab2.col2 from tab1,tab2where tab1.col1 between lowval and highval Since this join doesn't return rows based on a equality condition, it is called a non-equi join.Self Joinselect alias1.col1,alias2.col1 "Header 2" from tabname alias1,tabname alias2where alias1.col2=alias2.col3 In this example the table tabname is joined with itself. Using of two different alias names for the same table allows you to refer to it twice. Since the names of the resulting columns in this example are the same, the second column gets a new header. Outer Joinselect col1,col2 from tab1,tab2where tab1.col1=tab2.col2(+) Suppose you want to retrieve information from two tables where not all rows match but the result should contain all values from one or more columns. A simple join will select only matching rows whereas the outer join extends the result. All matching rows will be selected and when you append the outer join operator (+) to a column name, those rows which do not match will also be selected. In the example the number of rows which are selected is the number of rows in table tab2. If rows match, the outer join works as a simple join, if not, the values from tab2.col2 and a NULL value for the non existing value of tab1.col1 will be selected. تم تعديل 15 ديسمبر 2006 بواسطة moody_4u اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
amsh بتاريخ: 27 ديسمبر 2006 تقديم بلاغ مشاركة بتاريخ: 27 ديسمبر 2006 بسم الله الرحمن الرحيمالسلام عليكم ورحمة اللهلقد اجابك الأخ Moody_4u وقد وفى جزاه الله خيراُ ولكن اقتصرت اجابته على طرق الربط الخاصة بOracle ولتي كنت الوسيلة الوحيدة في الاصدارة 8i وماقبلها وهي غير متاحة في ANSI لذلك دعمت الاوراكل هذه الصيغ باضافة طريقة جديدة للربط وهي Joinوالصيغة النموذجية لها هي :SELECT table1.column, table2.columnFROM table1[CROSS JOIN table2] |[NATURAL JOIN table2] |[JOIN table2 USING (column_name)] |[JOIN table2ON(table1.column_name = table2.column_name)] |[left|RIGHT|FULL OUTER JOIN table2ON (table1.column_name = table2.column_name)];والسؤال عن الربط المتساوي والربط الغير متساوي(بتعبيري)فان عبارة Cross Join هي لاعطاء الجداء الديكارتي اما Natural Join,Join ...Using,Join...On(table1.column_nam=table2.column_name)فهي للربط بين جدولين باستخدام القيم في الأعمدة المستخدمة باعتبار تساوي القيم أي Equal Joinاما NunEqual Joinفيمكن التصريح عنها كمايلي:SELECT table1.column , table2.columnFROM table1JOIN table 2 ON (Join Condetion);حيث يمكن ان يكون شرط الربط مساواة أو اكبر او اصغر او اي شرط أخر معرف في أوراكلارجوا لكم من الله دوام التوفيق وسامحوني عن اي خطأ فيما كتب وأرجو اعلامي به وشكرا اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.