Help - Search - Members - Calendar
Full Version: SQL Query
Oracle DBA Forums > Oracle > Oracle Forum
sqlsurf
All,

I am trying to update all the birthdate (DATE) columns on a table in order to obfuscate them. I would like to change the Month to July and the day to the first BUT keep the same year of their original birth. Any suggestions?
burleson
>> I am trying to update all the birthdate (DATE) columns on a table in order to obfuscate them.



If you need to learn Oracle SQL fast, get the easy Oracle SQL book:

http://www.rampant-books.com/book_2005_1_easy_sql.htm
SteveC
update table_name
set mydate = add_months(trunc(mydate,'YYYY'),6);
sqlsurf
Like...A...glove!

Thanks, SteveC, you've made my weekend!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.