I have a query like this
SELECT date_format( doj, '%d/%m/%Y' ) AS week ,
WHERE doj between '2012-01-01'
group BY WEEK(doj)
week COUNT(user_id)06/01/2012 317/01/2012 225/01/2012 329/01/2012 1
Jul 23, 2012 at 09:08 AM
Jul 23, 2012 at 09:19 AM
In mySQL? No idea.
In TSQL - SELECT DATEPART(wk,GETDATE()) returns 31 - ie the 31st week since the start of the calendar year.
Jul 23, 2012 at 12:17 PM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
Need long-form SQL discussion? SQLserverCentral.com is the place.
asked: Jul 23, 2012 at 09:08 AM
Seen: 721 times
Last Updated: Jul 23, 2012 at 12:17 PM
Need your help with a query
SQL Server 2008R2 to My SQL using SSIS
MySQL query performance
How to store files in sql without converting to byte array
Update a table from another table
How to count where distinct?
Trading Card Database Design
Trigger for insert,update,delete to copy a table data from one databse to another present in different server location
Is there a difference between MySQL replication and SQL replication?
Log in Session for billing purpose.