I have a table, which shows information regarding trades. d_diff column shows the difference between endtime and begtime, measured in a number of days.
I want those rows, where d_diff > 1, to make duplicated (d_diff shows the number of duplicated rows.
The final dataset should look like in a table below. As you can see, in this table the difference between endtime and begtime is 1 (the table is more granular).
How can it be done? I tried to do kind of this
select * from main a
full outer join
main b
on a.begtime <= b.endtime

