dynamobi/dynamobi — Issue #548: [FRG-324] DISTINCT combined with ORDER BY of non-selected column produces unexpected results
Author: dynamobi-build
Created: 2011-12-30 03:34:44+00:00
State: closed
Labels: FRG, SQL Validator

[reporter="jvs", created="Tue, 24 Jun 2008 14:33:53 -0500 (GMT-05:00)"]
email from Kirk Abbot:

Kirk Abbott wrote:

> I don't think that distinct is working the way that it should...

> It the first query it pulls back multiple instances of the table where

> it does 'the right thing' in the second query

>

> -- Replace ETL_SCHEMA with your schema name...

>

> select distinct table_name

> from sys_root.dba_columns

> where schema_name = 'ETL_SCHEMA'

> order by

> table_name

> , ordinal_position

> ;

>

> select distinct table_name

> from sys_root.dba_columns

> where schema_name = 'ETL_SCHEMA'

> order by

> table_name

> ;