Home » SQL & PL/SQL » SQL & PL/SQL » Query to Translate and Replace: Pls Help (9i)
Query to Translate and Replace: Pls Help [message #340684] Wed, 13 August 2008 14:36 Go to next message
dksampat
Messages: 12
Registered: December 2006
Junior Member
I have a table which contains days of the week (in numbers) in a comma separated format. I need to replace the numbers with "Abbreviated Days of the Week"

For example, I ahve some sample rows as

1
1,2
1,5,6
3,5
...
...

This must be printed out as

MON
MON,TUE
MON,FRI,SAT
WED,FRI
..
..

In the above case, 0 is replaced by SUN, 1 by MON and so on...
Re: Query to Translate and Replace: Pls Help [message #340686 is a reply to message #340684] Wed, 13 August 2008 14:47 Go to previous messageGo to next message
BlackSwan
Messages: 25578
Registered: January 2009
Location: SoCal
Senior Member
why do I think this is a homework assignment?
Re: Query to Translate and Replace: Pls Help [message #340687 is a reply to message #340684] Wed, 13 August 2008 14:51 Go to previous message
Michel Cadot
Messages: 65150
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
clue (assuming aa/bb/yyyy is a sunday):
replace(col,x,to_char(to_date('aa/bb/yyyy','DD/MM/YYYY')+x,'Dy'))

Regards
Michel

[Updated on: Wed, 13 August 2008 14:51]

Report message to a moderator

Previous Topic: What's wrong with this PROC?
Next Topic: Using Bind Variable in IN Clause
Goto Forum:
  


Current Time: Mon Aug 21 16:52:30 CDT 2017

Total time taken to generate the page: 0.07648 seconds