SELECT t.* FROM thread t WHERE t.dateline >= unix_timestamp(START_OF_MONTH) AND t.dateline < unix_timestamp(END_OF_MONTH)