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: 26766
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: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
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: reg date function
Next Topic: remove duplicates
Goto Forum:
  


Current Time: Wed Feb 12 18:23:56 CST 2025