Skip to content
Advertisement

Merge the table based on date and condition

I have following table:

In this table type will be 1,2,3,4.. here date and type both are composite key.

I need to merge the row based if same date exist to single row and merge based on only below condition

and grp col is based on running count of date.

Expected Out put :

Advertisement

Answer

Try GROUP BY

FIDDLE DEMO

Output

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement