In one of our jobs we are using TIME_DIMENSION lookup..We are using below query in TIME_DIMENSION oracle stage "SELECT TIME_DIM_KEY,MONTH_OF_YEAR,YEAR FROM time_dimension where year=2008 and MONTH_OF_YEAR=11 ORDER BY
TIME_DIM_DATE" to get values of TIME_DIM_KEY,MONTH_OF_YEAR,YEAR.We need to get TIME_DIM_KEY for a source data based on YEAR,MONTH.
My doubt is as we are using ORDER BY clause which TIME_DIM_KEY we will get.Always we will get only one TIME_DIM_KEY or is there any possibility that we can get different values.I am getting different TIME_DIM_KEY values.
What's wrong in this query.Please suggest.
Lookup using a Order by clause
Moderators: chulett, rschirm, roy
-
Sainath.Srinivasan
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What is the grain of this time dimension?
In every query engine I have ever encountered, the selection is completed before the sort is attempted. This is so that the smallest possible number of records can be sorted.
In every query engine I have ever encountered, the selection is completed before the sort is attempted. This is so that the smallest possible number of records can be sorted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.