I have the following table
Pedimento | Partida | Identificador | Valor Agregado
6000001 | 1 | TL | 10
6000001 | 1 | PT | 10
6000002 | 1 | TL | 0
6000002 | 2 | XP | 0
6000003 | 3 | PT | 10
6000003 | 4 | TL | 10
How can I perform a query that returns all the records that contain the PT identifier and those that in the Value Added field is greater than 0 and do not contain the PT identifier?
Note: Motion - Part would be our group
The result should be something like this
Pedimento | Partida | Identificador | Valor Agregado
6000001 | 1 | PT | 10
6000003 | 3 | PT | 10
6000003 | 4 | TL | 10
Issue: The value added in the first record was wrong, it was 10 instead of 0, the problem with the query to filter those with added value greater than 0 is that it will bring me groups (pedimento - partida) duplicated (Por example the pediment 6000001 item 1 will be duplicated because one of its registers does not have PT identifier), what I need you to return me are pediment - heading groups that do not have a pt identifier in any of the rows