For me, SQL and relational databases were a step backwards from what I was using in 1982 and I cursed them until I retired 3 years ago. They work because the hardware’s power overcomes the deficiencies. Try this problem with SQL: Print sales, change in sales, by item and date.
My old code:
==>SELECT Sales, Sales – LAST Sales as Change by Item, Date
You can fix the bug with this:
==>SELECT Sales, IF Item <> LAST Item, 0,Sales – LAST Sales as Change by Item, Date