PostgreSql从date = current Date中选择

时间:2018-01-25 13:31:41

标签: sql postgresql

如何只选择DB中的数据(日期为葡萄牙语)=当前日期

SELECT id, data, dia, mes, ano,fornecedor, doc, valor_líquido, total
FROM public.fluxo_pagamentos where data = current_date;   

2 个答案:

答案 0 :(得分:1)

我可能怀疑data有时间成分。如果是这样,请尝试:

where data >= current_date::timestamp and
      data < current_date::timestamp + interval '1 day'

答案 1 :(得分:0)

施放到现在并立即使用()

SELECT id, data, dia, mes, ano,fornecedor, doc, valor_líquido, total
FROM public.fluxo_pagamentos where data::date = now()::date;