This content has been marked as final. Show 2 replies
Yes, you can not do that.
You should just use the following:
However this will cycle through all partitions because you have not given the optimiser any help whatsoever.
select col_date into b from test
If you said
then the optimiser will use the partition.
--explain plan for select col_date from test where col_date >=to_date('01-01-2012','DD-MM-YYYY') and col_date < to_date('01-01-2013','DD-MM-YYYY')
To see this just remove '--' from before explain plan for '
You should see the partition in your output.
select * from table(dbms_xplan.display());
Your previous query will show it is iterating through all the partitions.
Edited by: Keith Jamieson on Nov 20, 2012 3:52 PM