SELECT Distinct Year from timestamp mysql
This could be year, month, day, just change the format
zap::select('DISTINCT DATE_FORMAT(timestamp, "%Y") AS "Year" FROM leads');
gotta use zap - http://www.shayanderson.com/projects/zap.htm
RETURN Results from Range
//range is 2013-08
$rangeQuery = $range.'%';
zap::select('* FROM leads WHERE timestamp LIKE {@1}', $rangeQuery);
Written by Wayne Roddy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#