|
|
-
lenygold Commented 12 Months ago through Puzzles
DB2 RECURSIVE SOLUTION.
EVERYTHING IS POSSIBLE IN DB2.
IF IT IS IMPOSSIBLE, IN WILL TAKE LITTLE LONGER.
|
-
guna24x7 Commented 12 Months ago through Puzzles
-used Row_Number() to order Patient by AdmissionDate to get very first record for each patient.
-used Recursive CTE to iterate.
|
-
guna24x7 Solved 12 Months ago through Puzzles
-used Row_Number() to order Patient by AdmissionDate to get very first record for each patient.
-used Recursive CTE to iterate.
|
|
|
-
alesik Solved 12 Months ago through Puzzles
v2
inspired by DMoutray
this one is without recursive cte
|
|
|
|
|
-
Guenter Initial Review 1 Years ago through Puzzles
The challenge idea is taken from a problem discussed in the MSDN TSQL forum.
The challenge is to find the Islands(gaps) in sequential dates. You need to write a query to
identify continuous intervals from the start date and end date.
For example,
01/
|
-
Guenter Initial Review 1 Years ago through Puzzles
1. Row number
2. Temp column "IsContinous" which indicate the two continous records are in one time line.
3. Caculate the latest DisChargeDate for IsContinous=1
|
-
dave.zhou Solved 1 Years ago through Puzzles
1. Row number
2. Temp column "IsContinous" which indicate the two continous records are in one time line.
3. Caculate the latest DisChargeDate for IsContinous=1
|