473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

outher joins formats

Hi

I work ith sql server 2000 and i need know the diferent
of joins in format not ansi ( with * ) and joins in format
ansi ( with 'outher join on' ).
Two format work equal ???
What is de correct format ???
Thank you.

R.
Jul 20 '05 #1
2 3089
ra****@ozu.es (raulgz) wrote in message news:<9b**************************@posting.google. com>...
Hi

I work ith sql server 2000 and i need know the diferent
of joins in format not ansi ( with * ) and joins in format
ansi ( with 'outher join on' ).
Two format work equal ???
What is de correct format ???
Thank you.

R.


You should always use the ANSI syntax, because the 'old style' joins
are unclear, and some queries cannot be written at all with them. In
addition, Microsoft may stop supporting the old syntax in a future
version of MSSQL.

In an outer join, you need to separate the join condition (in the JOIN
clause) from the filter conditions (in the WHERE clause) to make sure
you get consistent results. In the old style join, all the conditions
are together in the WHERE clause, so the database engine has to
'guess' at what you meant, and the results may not be what you want.

This KB article shows the difference:

http://support.microsoft.com/default...&Product=sql2k

Simon
Jul 20 '05 #2
Read more about this by downloading SQL books online free from
http://www.microsoft.com/sql

INNER JOIN FORMATS (only identical rows)

select *
from tablea, tableb
where tablea.id = tableb.id

select *
from tablea inner join tableb
on tablea.id = tableb.id
RIGHT OUTER JOIN FORMATS (all rows on right, shows null on left where no
match)

select *
from tablea, tableb
where tablea.id =* tableb.id

SELECT *
from tablea right outer join tableb
on tablea.id = tableb.id

LEFT OUTER JOIN FORMATS (all rows on left, shows null on right where no
match)

select *
from tablea, tableb
where tablea.id *= tableb.id

SELECT *
from tablea left outer join tableb
on tablea.id = tableb.id

FULL OUTER JOIN FORMATS ( shows null where no match)

Select *
from tablea, tableb
where tablea.id FULL OUTER JOIN tableb.id

Select *
from tablea, tableb
where tablea.id FULL JOIN tableb.id

CROSS JOINS (cross product, all possible combinations)

select *
from tablea, tableb

select *
from tablea cross join tableb

****************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
an********@NOMORESPAM.yahoo.com

Please remove NOMORESPAM before replying.

This posting is provided "as is" with
no warranties and confers no rights.

****************************************

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jgalzic | last post by:
Hi, I'm having trouble doing joins correctly on two tables. I've read up a lot about the different types of joins and tried lots of variations on inner, outer, and left joins with no avail....
3
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName,...
4
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the...
4
by: michaelnewport | last post by:
Greetings, I like to write my inner joins as below, but someone at work tells me its not as 'performant' as using the 'inner join' statement. Is this true ? Is there a better way to write it...
7
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
2
by: Mark Jerde | last post by:
(If these are the wrong groups please suggest the right one(s). Thanks.) I need to come up with a way to test potentially thousands of data (files / records / streams) to determine if they match...
2
by: narendra vuradi | last post by:
Hi I have a requirement where in i haev to convert the SQL from Oracle to the one which will run on the SQL server. in the Oracle Query i am doing multiple joins, between some 13 tables. and...
9
by: shapper | last post by:
Hello, I am used to SQL but I am starting to use LINQ. How can I create Left, Right and Inner joins in LINQ? How to distinguish the different joins? Here is a great SQL example:...
36
by: TC | last post by:
I've used Access for many years. Several times, I've encountered a bug which I refer to as the "Vanishing Joins" bug. When it happens, joins vanish randomly from queries. More specifically, all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.