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 '12 at 09:08 AM
Jul 23 '12 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 '12 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 '12 at 09:08 AM
Seen: 654 times
Last Updated: Jul 23 '12 at 12:17 PM
SQL query to Retrive only Date part from "91030 Dt. 14/7/2007"
How to convert sql server to mysql
can allow user select the column ?
how to use cast,in mysql when union is used
Insert into openquery MySQL
projection from a query
50 to 60 million records.Hardware Config required
How can i make auto copy of table data from one Mysql db to another Mysql db present in different server location
Naming conventions - MySQL