Add sql script for calculating rank per hour