Home » SQL & PL/SQL » SQL & PL/SQL » using partition name with date function to_char(sysdate,'ddmmyy')
using partition name with date function to_char(sysdate,'ddmmyy') [message #204188] Sat, 18 November 2006 12:39 Go to next message
gjayasekar
Messages: 45
Registered: October 2005
Member

Hi,

I am using table with partitions
here i want to select the current partition name with the date function to_char(sysdate,'ddmmyy')

Please suggest me.

partition name is p_18nov2006 - here partition are created range by (date_time) column.


select * from prod partition(p_18nov2006);
Re: using partition name with date function to_char(sysdate,'ddmmyy') [message #204200 is a reply to message #204188] Sat, 18 November 2006 18:01 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Just do:
SELECT * FROM prod
WHERE partcol = to_char(sysdate,'ddmmyy')

You cannot dynamically select the partition from wich you want to select in a straight SQL.

Ross Leishman
Previous Topic: Problem ... Update Query with join two tables
Next Topic: Grouping and Merging Data
Goto Forum:
  


Current Time: Sun Dec 04 12:35:02 CST 2016

Total time taken to generate the page: 0.05676 seconds