Learn Sql Join, Inner Join, Outer Join

xiaoxiao2021-03-06  41

For Example: Table A Have 12 (8 4) Entries, 8 Entries Have Valid Relation with BTable B Have 80 (77 3) Entries, 77 Entries Have Valid RELANT OF JOIN IS: Cross Join: 12 * 80INNNER JOIN: 77FULL OTER JOIN: 77 4 3LEFT OUTER JOIN: 77 4RIGHT OUTER JOIN: 77 3INNNER JOIN CODE AS The FOLLOWING: SELECT * FROM A a, B B Where a.categoryId = B.categoryId; Equals : Select * from a a a a a oneInr Join B on a.categoryid = B.CategoryId; Outer Join Code As the FollowingSelect * from a a full (left / right) Outer join b b on a on a.categoryId = B.CategoryId; Left / Right Outer Join Claus Specific for MSSQL: Select * from A a, b B Where a.categoryid * = bcategoryID; Elect * from A a, b b.categoryId; Left / Right Outer Join Claus Specific for Oracle: Select * from A A, B Where a.categoryid = B.CategoryId ( ); SELECT * from A A, B WHERE A.CategoryId ( ) = B.CategoryId; Good Resources:

http://www.w3schools.com/sql/sql_join.asphttp://www.techonthenet.com/sql/joints.htm

转载请注明原文地址:https://www.9cbs.com/read-70401.html

New Post(0)