INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Newbie SQL Question about Linking Tables

Newbie SQL Question about Linking Tables

(OP)
I have been using SQL Server for the last couple years and now find myself having to write queries in Teradata SQL Assistant.

I have been looking all over the internet, but can't seem find an answer to why so many examples I see have a "From" clause that contain no join information.

I keep seeing queries like the the one below..

Select A.Field1, B.Field2
FROM A,B
WHERE A.Key=B.Key

Is this doing some type of cross-join and using the where clause limit the records?  Is there a default join type? (Inner/Outer)  Is there a performance boost by using this syntax?

Thank you in advance!

sabloomer

RE: Newbie SQL Question about Linking Tables

It's just a traditional join as opposed to ANSI join. I see a lot of people using traditional joins as well, to no explanation.
I've not noticed any performance advantage to using Traditional joins in Teradata.

Stick with the ANSI, but beware the (awful) syntax; you'll still gain a lot of value out of the well-formated .sql files.
 

RE: Newbie SQL Question about Linking Tables

(OP)
Gruuuu,

That is a big help.  The big question is performance, and if there is no advantage I am going to stick with what I am more comfortable with.

Just for my knowledge, Did I provided an example of a "traditional" inner join?  Is there such thing as a "traditional" outer join?

Thanks Again!

sabloomer
 

RE: Newbie SQL Question about Linking Tables

Yes, that is a traditional inner join (JOIN or INNER JOIN in ANSI).

...I do not even remember the syntax for traditional outer joins in Teradata.

Can't even find it in the developer reference

For most other DBMS environments, it's
SELECT A.Fiel1, A.Field2
FROM A,B
WHERE A.key = B.key (+);
...
WHERE A.key (+) = B.key;

But the real fun comes in with a full outer join. You have to UNION a LEFT OUTER and a RIGHT OUTER query.

So, yes, ANSI is ...probably preferable.

RE: Newbie SQL Question about Linking Tables

(OP)
Gruuuu,

Thank you for clearing that up, it was a big help.

sabloomer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close