Converting Resultset Into User Defined Name using select query in sql
example
SELECT date_format( doj, '%d/%m/%Y' ) AS week ,COUNT(user_id) FROm user_tb
WHERE doj between '2012-01-01' AND '2012-01-31' group BY WEEK(doj)
Outlput will be like this
Result
week COUNT(user_id)
06/01/2012 3
17/01/2012 2
25/01/2012 3
29/01/2012 1
example
SELECT date_format( doj, '%d/%m/%Y' ) AS week ,COUNT(user_id) FROm user_tb
WHERE doj between '2012-01-01' AND '2012-01-31' group BY WEEK(doj)
Outlput will be like this
Result
week COUNT(user_id)
06/01/2012 3
17/01/2012 2
25/01/2012 3
29/01/2012 1
Comments
Post a Comment
Please avoid link comments