I have an application that should show in a dbgrid only the id that is equal to the service order and has the same id in another table:
The ID_OrdemServico
comes from the ordem_servico
table by foreign key to pecas_ordem_servico
, I would like to show used parts only where IDs were equal
below the code that at the moment shows all the records:
select * from pecas_ordem_servico
where pecas_ordem_servico.id_OrdemServico = Id_OrdemServico