Exadata General (MOSC)

MOSC Banner

When I used 'where column=1', I got the result as 1 and 2

edited Mar 11, 2012 9:09PM in Exadata General (MOSC) 3 commentsAnswered
Hi All,
My db is exadata 11.2.
In a short, when I issued one SQL that has predicate'sales_date= date_1', it returned date_1 and date_2, two differenct dates.
But if I I issued the SQL that has predicate'sales_date - date_1 = 0', it returned only date_1.

The table adwg_gpos.GXXX_CD_FYYS is partitioned on SRCE_SYS_ID, which is in turn subpartitioned on sales_date.

Copyright (c) 1982, 2007, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
 
SQL> select distinct sales_date
  2   from (
  3   SELECT *
  4    FROM adwg_gpos.GXXX_CD_FYYS t
  5   WHERE SRCE_SYS_ID = 3240
  6   AND sales_date-TO_DATE(<font color="#000080">'20111121'</font>, <font color="#000080">'yyyymmdd'</font>)  =0
  7   ORDER BY SALES_DATE DESC
  8   )
  9   where sales_date = TO_DATE(<font color="#000080">'20111121'</font>, <font color="#000080">'yyyymmdd'</font>)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center