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: 769 times
Last Updated: Jul 23, 2012 at 12:17 PM
Export to Mysql
Which among row level and statement level triggers is effective
sql query on 'select within select'
how to create a database
Insert statement is leaving twice as many rows at it should
log shipping with mysql
Need career advice on returning to IT
I want to delete total tables at time ?
Need your help with a query
SQL Server 2008R2 to My SQL using SSIS