0
I’m having difficulty listing only one line of each process.
The query must always bring the protocols with the last revision.
Ex: Show last revision 2 number process only
and Show only last revision revision process 1
Select
Numero_Processo Processo
, Numero_Revisao Revisao
,Titulo
,Id
,Data_Criacao
FROM Qualidade_Insp_Inj_Processo
WHERE Data_Exclusao is null
order by Numero_Processo desc, Numero_Revisao desc
I’ve tried Group By, but as the field review is always different it brings all protocols with all revisions
There are several ways> to use row_number aggregating by the column you want or a self-join or even a subqueri p/ return the max by some criteria and then return only the records that satisfy the sub-query. Please post a question about query taggear with DBMS as several features are not SQL Ansi
– jean