Posts by Paulo Coelho • 1 point
1 post
-
0
votes3
answers33401
viewsA: Select 1 record of each ID based on the last date
I’m sorry but the code above is wrong: The right thing would be: SELECT DISTINCT(TQ.[COD_VENDEDOR]), TQ.[VAL_META], TQ.[DAT_ATIVACAO] FROM [dbo].[TB_META] TQ WHERE TQ.DAT_ATIVACAO = (SELECT…