Posts by Fábio Pietro • 9 points
3 posts
-
0
votes2
answers1131
viewsA: SQL QUERY using MAX function
Good morning, You can use a subquery to pick up the expiration date for each subscriber, then mount the Inner Join using this subquery, give a look SELECT ASS.Inscricao AS numero_contrato,…
-
0
votes5
answers7016
viewsA: How to delete all duplicates except one?
Not questioning the technical merit of the proposed solutions, but when I face it I simply do something like this: SELECT DISTINCT COLUNA1 ,COLUNA2 ,COLUNA3 INTO #TEMP FROM TABELA WHERE COLUNA =…
-
0
votes2
answers121
viewsA: SQL Update from another tab
Hello, You can use an OUTER APPLY to solve this without using subquery UPDATE A SET pm = ISNULL(C.pm, 0) FROM dimproduto as A OUTER APPLY ( SELECT AVG(vu) AS pm FROM dimdocumento AS B WHERE A.prodid…