Click here to Skip to main content
16,005,281 members
Home / Discussions / Database
   

Database

 
GeneralRe: Sql database modification Pin
Colin Angus Mackay19-May-05 22:54
Colin Angus Mackay19-May-05 22:54 
GeneralRe: Sql database modification Pin
webhay20-May-05 0:33
webhay20-May-05 0:33 
GeneralRe: Sql database modification Pin
Colin Angus Mackay20-May-05 0:42
Colin Angus Mackay20-May-05 0:42 
GeneralRe: Sql database modification Pin
webhay20-May-05 0:48
webhay20-May-05 0:48 
GeneralRe: Sql database modification Pin
GreggS20-May-05 6:08
GreggS20-May-05 6:08 
GeneralHELP!!! using distinct keyword causes error 0x80040E21 Pin
oyinbogo19-May-05 7:21
oyinbogo19-May-05 7:21 
Generalhelp in undertsnading the joins Pin
satishrg19-May-05 5:31
satishrg19-May-05 5:31 
GeneralRe: help in undertsnading the joins Pin
Colin Angus Mackay19-May-05 6:39
Colin Angus Mackay19-May-05 6:39 
Lets say you have 2 tables A and B which cotains the following data

A    B
--   --
1    1
2    2
4    3
6    4
7    5
8    6


An INNER JOIN will only match rows from two tables where the join condition matches on BOTH sides of the join.
SELECT * FROM A INNER JOIN B ON A.A = B.B
A B
----
1 1
2 2
4 4
6 6


A LEFT OUTER JOIN will return everything on the left side and the matches on the right side leaving nulls if there is no match
SELECT * FROM A LEFT OUTER JOIN ON A.A = B.B
A B
------
1 1
2 2
4 4
6 6
7 null
8 null


A RIGHT OUTER JOIN is similar but it will return everything on the right side and the matches on the left side leaving nulls if there is no match
SELECT * FROM A RIGHT OUTER JOIN ON A.A = B.B
A   B
-------
1    1
2    2
null 3
4    4
null 5
6    6


A FULL OUTER JOIN returns everything on both sides leaving nulls if there is no match
SELECT * FROM A FULL OUTER JOIN ON A.A = B.B
A   B
-------
1    1
2    2
null 3
4    4
null 5
6    6
7    null
8    null


Does this help you see the patterns that are created by these join types?


DISCLAIMER: I created these results from my head. There may be errors


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: help in undertsnading the joins Pin
satishrg19-May-05 7:58
satishrg19-May-05 7:58 
GeneralRe: help in undertsnading the joins Pin
Colin Angus Mackay19-May-05 12:34
Colin Angus Mackay19-May-05 12:34 
Questionproblem with update a row? Pin
Sasuko19-May-05 5:10
Sasuko19-May-05 5:10 
AnswerRe: problem with update a row? Pin
Colin Angus Mackay19-May-05 5:31
Colin Angus Mackay19-May-05 5:31 
GeneralRe: problem with update a row? Pin
Sasuko19-May-05 11:41
Sasuko19-May-05 11:41 
AnswerRe: problem with update a row? Pin
Luis Alonso Ramos19-May-05 14:09
Luis Alonso Ramos19-May-05 14:09 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 2:57
Sasuko20-May-05 2:57 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 4:19
Sasuko20-May-05 4:19 
GeneralRe: problem with update a row? Pin
Luis Alonso Ramos20-May-05 4:58
Luis Alonso Ramos20-May-05 4:58 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 5:00
Sasuko20-May-05 5:00 
GeneralRe: problem with update a row? Pin
Luis Alonso Ramos20-May-05 5:11
Luis Alonso Ramos20-May-05 5:11 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 5:21
Sasuko20-May-05 5:21 
GeneralRe: problem with update a row? Pin
Blue_Boy24-May-05 4:01
Blue_Boy24-May-05 4:01 
Generalpicture inserting.please help me! Pin
rohollahabadan19-May-05 2:20
rohollahabadan19-May-05 2:20 
GeneralRe: picture inserting.please help me! Pin
NewSilence21-May-05 12:11
NewSilence21-May-05 12:11 
GeneralRe: picture inserting.please help me! Pin
rohollahabadan22-May-05 21:23
rohollahabadan22-May-05 21:23 
Generalplease help me .please please.... Pin
rohollahabadan19-May-05 2:12
rohollahabadan19-May-05 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.