javascriptsqlsql++

How to get only full hour data


Hy in my DB i have data that occurs every 10 min (timestamp) and i would like to get only those that have timestamp that is equal to full hours between one timeframe

for example only those that have timestamp time equal 09.00, 10.00, 11.00, 12.00, 13.00


Solution

  • Extract the minute portion of the timestamp with DATE_PART_STR(mydate, 'minute') then compare it to zero.