Oracle SQL tips and tricks + Unix/Linux Work Log

See how much a single Oracle SQL statement can do... Plus some Unix/Linux Work Log

Wednesday, October 03, 2007

Convert a stats input date to Edward date_sid

Old way of doing it:
select to_char(to_date('09/01/2007', 'MM/DD/YYYY'), 'YYYYMMDD') from dual;

New way with regexp
select regexp_replace('09/01/2007', '(\d{2})/(\d{2})/(\d{4})', '\3\2\1') from dual

reduced function call to 1
Posted by Huiming Li at 4:14 PM 2 comments:
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2021 (2)
    • ►  June (1)
    • ►  May (1)
  • ►  2019 (1)
    • ►  May (1)
  • ►  2017 (1)
    • ►  August (1)
  • ►  2016 (1)
    • ►  February (1)
  • ►  2015 (1)
    • ►  November (1)
  • ►  2013 (4)
    • ►  November (3)
    • ►  April (1)
  • ►  2012 (2)
    • ►  January (2)
  • ►  2010 (4)
    • ►  December (1)
    • ►  October (1)
    • ►  September (1)
    • ►  April (1)
  • ►  2008 (5)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  June (1)
  • ▼  2007 (7)
    • ►  December (1)
    • ▼  October (1)
      • Convert a stats input date to Edward date_sid
    • ►  August (1)
    • ►  May (2)
    • ►  January (2)
  • ►  2006 (24)
    • ►  December (3)
    • ►  November (1)
    • ►  August (3)
    • ►  July (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (4)
    • ►  February (7)

About Me

Huiming Li
Life is a transaction with no option to issue a rollback.
View my complete profile

Links

  • Ask Tom
  • If you read chinese
  • Chinese Chess
Simple theme. Theme images by tjasam. Powered by Blogger.