Archives of the TeradataForum
Message Posted: Fri, 11 Feb 2005 @ 19:33:50 GMT
Subj: | | Re: Guidelines for using Distinct vs. group by |
|
From: | | Dieter Noeth |
Bob Duell wrote:
| I'm sure I'm missing something. Are you saying all subqueries have an implicit "distinct"? | |
Yes, unless the optimizer knows about uniqueness (unique/PK column or Union in subquery) there's an implict distinct.
Another case without distinct was described by Michael Larkins:
If the subquery is on NUPI column[s], the optimizer will probably choose an "inclusion merge join" and join only to the first
occurance of a value.
Just Explain subqueries...
Dieter
|