If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Can anyone convert this Oracle sql to MySQL?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-13-07, 03:39
dayneo dayneo is offline
Registered User
 
Join Date: Oct 2002
Location: Cape Town, South Africa
Posts: 161
Red face Can anyone convert this Oracle sql to MySQL?

Hi guys and gals,

I am doing some integration from Oracle to MySQL and need to know the quivelent MySQL sql for the following Oracle sql:
Code:
select trunc(sysdate) from dual
Basically selecting the current system date without the time part (ie. 13/02/2007).

Thanks
Reply With Quote
  #2 (permalink)  
Old 02-13-07, 04:42
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
What's wrong with
Code:
SELECT CURDATE()
See: Date and Time Functions
Reply With Quote
  #3 (permalink)  
Old 02-13-07, 05:18
dayneo dayneo is offline
Registered User
 
Join Date: Oct 2002
Location: Cape Town, South Africa
Posts: 161
That simple hey ... I feel like a real idiot.
Thanks!
Reply With Quote
  #4 (permalink)  
Old 02-13-07, 07:39
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
actually CURRENT_DATE would be better, since it's standard sql

(you will be less likely to need to change it again if you switch database systems once more)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On