sub queries

Database

sub queries


hi ppl....any idea hw many sub queries one can give in one sql command in teradata...i mean wats the limit fr number of sub queries tat one can use in a sql statement at one go...??
4 REPLIES

Re: sub queries

As far as i can remember, v2R5 supports 16 sub-query nesting levels in a query

Re: sub queries

Hi every body......
with respect to performance.....which one is best?
either subquiery or inner join?

Re: sub queries

hi,

An inner join will give better performance than a sub query when the volume of data to be retrieved is huge.For small volume of data, there is very little difference in their performances.

Regards,

Rock
N/A

Re: sub queries

Teradata performs a query rewrite and replaces any kind of [correlated] subquery with joins.
Thus in many cases there will be no difference between Subquery and Join, just check Explain.

You just have to take care because subqueries are DISINCT by default, so it might be more efficient to use a GROUP BY overriding that default.

Dieter