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
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)