473,671 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3105
ra****@ozu.es (raulgz) wrote in message news:<9b******* *************** ****@posting.go ogle.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********@NOMO RESPAM.yahoo.co m

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
2079
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. Something isn't correct with my logic so could anyone give me some pointers on it? I have 2 tables: CourseRoster: ID CourseID StudentID StudentType
3
6411
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, Employees.LastName, TerritoryID, Employees.EmployeeID, RegionID, ProductID from Employees
4
4101
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 results, then doing a self left join with those results, etc. What puzzles me is that the time required for the query seems to grow exponentially as I add additional left joins, which I didn't expect. I expected the inner select to return about 25...
4
2042
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 ? thanks
7
31549
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" slows the system down considerably. I've tried creating a temp db, but I can't figure out how to execute two select commands. (It throws the exception "The column prefix 'tempdb' does not match with a table name or alias name used in the query.")
2
1335
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 one of about thirty defined data formats. If a record partially matches one of the formats I need to log why it failed. The formats are byte-oriented. Byte 0 is the type, byte 1 is the subtype, bytes 2-5 give the total record length, etc. ...
2
19718
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 some of these joins are inner joins and some are Left outer joins. table1 inner joined with table 2 table2 inner join with table3 table2 inner join with table4 table2 left join with table5
9
11916
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: http://www.codinghorror.com/blog/archives/000976.html
36
2485
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 joins vanish from at least one (seemingly random) query. I've always regarded the Vanishing Joins bug as a symptom of corruption. When it happens, I usually give my users advice on how to recover from corruption, and how to avoid it in the future....
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8402
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8927
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8825
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6237
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.