Hello All,
In my database i have a table with two timestamp fields like startDate and endDate
Now i want to pass startDate and endDate in my query and according to the difference between those dates i want to group the data by hours.
example 1) If differece is 24 hours then i will get 00-23
example 2) If the difference is 48 hours then i want to group 2 hours of the same day so i can finally get only 24 rows
|
|
example 7) If difference is 168 hours ie 7 days then group by 7 hours
condition is group hours of the same day