سلام
همونطور که توی عنوان مشخصه می خواستم تفاوت این سه مدل اتصال رو توی کوری بدونم . ممنون
Printable View
سلام
همونطور که توی عنوان مشخصه می خواستم تفاوت این سه مدل اتصال رو توی کوری بدونم . ممنون
جای این سوال اینجا نیست، اینجا بخش دلفی است
در Inner join فقط رکوردهایی نمایش داده میشوند که در شرط مطابقت داشته باشند.و اگر در جدول اول رکوردی وجود داشته باشه که با هیچ رکوردی از جدول دوم مطابقت نداشته باشه، در نتیجه نهایی نمایش داده نمیشه.
در Left join تمام رکوردها از جدول اول(جدول سمت چپ join) نمایش داده میشه، حتی اگر با هیچ رکوردی از جدول دوم مطابقت نداشته باشه.
Right join برعکس left join عمل میکنه و تمام رکوردهای جدول دوم(جدول سمت راست join) رو نمایش میده، حتی اگر با هم مطابقت نداشته باشند.
نکته مهمی که در تفاوت Inner Join و Outer Join باید بدونین این هست که در Inner Join رکوردهای حذف شده در شرط ON، دیگه حذف شده اند و بلافاصله شرط WHERE (اگر وجود داشته باشه) اعمال میشه. لذا در Inner Join میتونین شرط WHERE رو به قسمت ON هم منتقل کنین. اما در Outer Join پس از پایان شرط ON، رکوردهای حذف شده مجددا به Result Set برمیگردن و چون با جدول طرف دیگه Match نشدن، براشون Null بدست میاد. پس از این مرحله شرط WHERE اعمال میشه