Further refined time selector of SQL query