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: 3728
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: Mon Dec 09 20:49:52 CST 2024