Sql of note

From Federal Burro of Information
Revision as of 14:40, 9 November 2010 by David (talk | contribs) (New page: == Example of Time bucket == <pre> select from_unixtime(timestamp-timestamp%3600)as time, count(*) from table where data like 'Destination directory %does not exist at%' and FROM_UNI...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Example of Time bucket

select
 from_unixtime(timestamp-timestamp%3600)as time,
 count(*)
from
 table
where
 data like 'Destination directory %does not exist at%' and
 FROM_UNIXTIME(timestamp) > subdate(now(),interval 4 day)
group by timestamp-timestamp%3600
order by time;