Category "self-join"

How to do Group By and SELF JOIN in single table

Here is what I am trying to get done. Partly I am thru, Partly I am stuck, and need some help. Table structure: CREATE TABLE UserRole ( Id bigint NOT NULL A

Use date (-1 day) on next row to be the end date for current row

I am trying to self join in my current script in order to find the next row and then whatever day specified it should minus 1 day from it and put that in the e