Created
          November 6, 2021 09:38 
        
      - 
      
 - 
        
Save OmgImAlexis/2fbd8c913815b31c2379408921a1f0ae to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | SELECT views, case WHEN (hour(now()) + x) >= 24 THEN (hour(now()) + x) - 24 ELSE hour(now()) + x END AS part FROM long_sequence(24), | |
| JOIN (SELECT count() as views, hour(timestamp) as part FROM hits WHERE timestamp > dateadd('d', -1, now()) GROUP BY part) as b | |
| ON part = b.part | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Current results.