0
have the following query sql - code below - and I would like to increment in it a "filter" of the most recent Insert so that the query is the latest pro Insert.
$sql = "
select
ec.id_contrato,
e.nome_entidade,
c.valor_total_contrato,
c.situacao,
c.data_criacao
from
tb_entidade e, tb_entidade_contrato ec, tb_contrato c
where
e.id_entidade = ec.id_entidade
and c.id_contrato = ec.id_contrato
and ec.id_entidade_tipo = 1
group by
id_contrato, nome_entidade;
";
*I have a column called "data_creation" with type "datetime NULL [current_timestamp()]", I believe the filter can start from there.
for example:
It worked, thank you!
– marco antonio