Posts by Marcelo • 26 points
3 posts
-
0
votes2
answers199
viewsA: How to insert grouped data from one table to another SQL
I thought of a method here very quiet, you will group and select the MIN of the time field and the MAX, make a case when the MIN and the MAX are equal bring null. Then just make a recursive to bring…
-
0
votes1
answer62
viewsA: Return of Maximum value
Good night, With this code below, if there are generous with equal values he will bring both. OBS:I left the code as much space as possible for better understanding. SELECT T1.* FROM (SELECT…
-
1
votes2
answers541
viewsA: IF/ELSE in SQL (Control Structures)
I usually use the When clause instead of IF, however.... Works similar to the programming structures of other languages. In SQL Server, the IF statement ... ELSE is used to execute the code when a…