Advertisement
TDCustmerSupportJP

Untitled

Aug 10th, 2017
22,306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.49 KB | None | 0 0
  1. SELECT
  2.   TD_TIME_FORMAT(time,'yyyy-MM-dd HH:mm:ss','JST') AS t,
  3.   TD_DATE_TRUNC('minute',  time, 'JST' ) AS mnt,
  4.   TD_DATE_TRUNC('hour',    time, 'JST' ) AS h,
  5.   TD_DATE_TRUNC('day',     time, 'JST' ) AS d,
  6.   TD_DATE_TRUNC('week',    time, 'JST' ) AS w,
  7.   TD_DATE_TRUNC('month',   time, 'JST' ) AS m,
  8.   TD_DATE_TRUNC('quarter', time, 'JST' ) AS q,
  9.   TD_DATE_TRUNC('year',    time, 'JST' ) AS y
  10. FROM access_log
  11. WHERE TD_TIME_RANGE(time,'2017-01-15','2017-01-16','JST')
  12. ORDER BY t DESC
  13. LIMIT 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement