Further, about joins, we have already seen that left outer join clause use makes sql server to dispaly all records form the left hand side table and only relative values satisfying the condition related with the earlier records gets listed. In this webpage we will see the right outer join for sql....

RIGHT OUTER JOIN STATEMENT FOR SQL

SELECT Table1.field1, Table1.field2..., Table2.field1, Table2.field2, Table2.field4,.... FROM Table1 RIGHT OUTER JOIN Table2 ON Table1.field1 = Table2.field1

In the above statment, field1 in table1 and field1 in table2 should have the same datatypes and lengths. All the records from the table 2 i.e. from the right hand side table of the clause "RIGHT OUTER JOIN" will get diplayed with the only 'conditional criteria' satisfying records from the left hand side table of the clause "RIGHT OUTER JOIN" i.e. Table1

Example : if two table table1 and table 2 are having following data then : Data of table 1

fields - Name Address1 Address2 TelNo
Record 1 data "A.Symonds" "Gr.Floor, ABC Apartments" "XYZ Road, Area XMS" "5879879870"
Record 2 data "M. Jones" "3rd Floor, HTX Apartments" "GHJ Road, Area ZXC" "6548736843"
Record 3 data "G. Haynes" "2nd Floor, JUI Apartments" "RTY Road, Area OPU" "4564654879"


Data of table 2

fields - Name Address1 Address2 TelNo
Record 1 data "A.Symonds" "3rd Floor, UTV Apartments" "BHY Road, Area ADF" "4564897987"
Record 2 data "M. Jones" "Gr. Floor, AJH Apartments" "ATY Road, Area HTY" "4894465465"
Record 3 data "M. Koni" "4th Floor, RED Apartments" "MXS Road, Area NOT" "7897246814"

Continued on next page.....

Incomedia WebSite X5 Evolution Registry Mechanic
Kaspersky Anti Virus 2009