Jump to content

date() in sql statements


brown2005

Recommended Posts

Glad it worked, taught myself something new there too.  I'm used to working in Oracle, so I took the following oracle code...

[code]
SELECT to_char(date_column, 'YYYY') "Date", count(*) "Count"
FROM table_name
GROUP BY to_char(date_column, 'YYYY')
ORDER BY "Date" DESC
[/code]

... and then worked out what the equivalent functions were in MySQL.

I've posted this here for anyone who comes across your post and wonders how to do it in Oracle.

Rich
Link to comment
https://forums.phpfreaks.com/topic/19752-date-in-sql-statements/#findComment-86291
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.