SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT  
  2. CAST(DATEDIFF(HH,localTime,serverTime)-1  AS VARCHAR) +'-'+
  3.     CAST(DATEDIFF(HH,localTime,serverTime)  AS VARCHAR) [Hours],
  4. COUNT(*) [Count]
  5. FROM your_table
  6. GROUP BY CAST(DATEDIFF(HH,localTime,serverTime)-1  AS VARCHAR) +'-'+
  7.     CAST(DATEDIFF(HH,localTime,serverTime)  AS VARCHAR)
  8.      
  9. select diff_hours,count(diff_hours) from (select 24 * (to_date(LocalTime, 'YYYY-MM-DD hh24:mi') - to_date(ServerTime, 'YYYY-MM-DD hh24:mi')) diff_hours
  10. from T_TIMETABLE ) group by diff_hours order by diff_hours;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top