select from date in the postgreSQL database

6

How do I make a select in the postgreSQL database for it returns the data from a specific date, for example I have a field of type timestamp with name data_interview, I want it to bring me the data registered from the present day forward .

SELECT * FROM tabela Where data_entrevista = data de hoje para frente
    
asked by anonymous 19.10.2016 / 18:46

2 answers

5

Use >= to bring only recent dates:

SELECT * FROM tabela Where data_entrevista >= '2016-10-19 00:00:00' 
    
19.10.2016 / 18:50
4

As the field is timestamp (date and time) you can cast% ( ::tipo ) to date and compare with current date CURRENT_DATE

SELECT * FROM tabela Where data_entrevista::date >= CURRENT_DATE

Postgres - documentation - Datetime

    
19.10.2016 / 19:00