2
Hello! staff I am trying to select and apply a rule only in equal records. I need all records to be listed, but in those that are equal, a specific rule is applied;
For example, select all client records, and in all that have the same codDeference, group and show only q has the non-blank;
I’m trying like this:
select * from clientes group by codDeReferencia where id in(select distinct codDeReferencia from clientes where dataAlteracao!='')
I suggest you put up some evidence so we can help you. So you suggest you can have a "group by + having" but without the data is difficult.. Creates a SQL Fiddle and shares
– jtomaszon