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

How to do join in Teradata

How to do join in Teradata

(OP)
Hi,

1) I have 5 huge tables with disjoi1nt data columns except the PI and date column.I need to merge the data into one table so that, one row per account(PI) is created with individual data columns from the 5 tables. The accts may or maynot match between the tables. How do I do this without performance issues? LEFT JOIN?

2) I have a one-rowed table which has NUPI of run-date. Some data tables have acct-key as UPI and run-date as PPI.But some data tables have neither acct-key nor run-date columns. I might have to build join across tables-with-columns, tables-without-those-columns and the one-row table to evaluate data in CASE statements. EXPLAIN shows product join and is badly skewed. How can I rewrite this better?
Ex: T1(huge table with columns)
T2(huge table without columns)
SR(single row table)
sel
Sum(case
when T1.t1 = 'X' and
SR.code = ' ' and
T2.t2 = 'Y'
then 'GOOD ACCT'
end) as qualified_acct
from
T1, T2, SR
where
T1.acct-key = T2.acct-key and
T1.run-date = SR.run-date;


RE: How to do join in Teradata

This may not be helpful, but did you turn on diagnostic stats and run the suggested collect statistics?  

"Diagnostic Helpstats On for Session;"

Then run your explain, and at the bottom it should suggest statistic to collect to help optimize the query.

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