|
|
-
Guenter Initial Review 1 Years ago through Puzzles
The challenge is to identify the sequence of accounting transactions. The table has data which is ordered.
You need to follow the order of the data, and detect a certain condition which lasts for a sequence of data rows,
you need to give these data poi
|
|
|
|
|
-
organiccoder Commented 1 Years ago through Puzzles
hey Keerthyrr,
oganiccoder here. - I also submitted a recursive solution a few days ago; it is available for viewing. - (don't be confused. - i have 2 different solutions out there; the second one is the recursive one.) - would be interested to see you
|
-
Guenter Initial Review 1 Years ago through Puzzles
The challenge is to identify the sequence of accounting transactions. The table has data which is ordered.
You need to follow the order of the data, and detect a certain condition which lasts for a sequence of data rows,
you need to give these data poi
|
-
Guenter Initial Review 1 Years ago through Puzzles
The challenge is to identify the sequence of accounting transactions. The table has data which is ordered.
You need to follow the order of the data, and detect a certain condition which lasts for a sequence of data rows,
you need to give these data poi
|
-
Guenter Initial Review 1 Years ago through Puzzles
1. Created an Row number for each records
2. used recursive Query to loop through each record based on Row # and used case statement to find the Block # and Row in block #.
|
-
Guenter Initial Review 1 Years ago through Puzzles
this is my second solution - different from first (i.e. new approach, not a refinement of first) - may work better; not sure why -- kind of avoided some of the self-joins by using recursion, which I expect brings its own issues. -- have seen some discussio
|
-
Guenter Initial Review 1 Years ago through Puzzles
Take 3 .. not the cleanest code..
I got the 1 pass.
(10000 row(s) affected)
Table 'TC76'. Scan count 1, logical reads 43, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Executio
|
-
Guenter Initial Review 1 Years ago through Puzzles
Take 4. Got rid of a 4th sort and built it as a CTE for read ability.
|