Good Morning All,
I have a scenario where I have to get the total count of the days.
Data in the table:
col1 col2 col3
101 12/12/06 A
101 02/15/07 H
101 03/10/07 B
101 04/18/07 C
101 05/27/07 H
101 06/30/07 C
101 06/31/07 H
101 07/04/07 S
102 07/13/07 A
102 07/30/07 B
All the three columns are keys. I have to check for the 'H' in col3 and get the count of days based on immediate record (ex : days between of 02/15/07 & 03/10/07, 05/27/07 & 06/30/07 and 06/31/07 & 07/04/07). And get the total sum of the days.
I have to do it in SQL.
Thanks in advance
I have a scenario where I have to get the total count of the days.
Data in the table:
col1 col2 col3
101 12/12/06 A
101 02/15/07 H
101 03/10/07 B
101 04/18/07 C
101 05/27/07 H
101 06/30/07 C
101 06/31/07 H
101 07/04/07 S
102 07/13/07 A
102 07/30/07 B
All the three columns are keys. I have to check for the 'H' in col3 and get the count of days based on immediate record (ex : days between of 02/15/07 & 03/10/07, 05/27/07 & 06/30/07 and 06/31/07 & 07/04/07). And get the total sum of the days.
I have to do it in SQL.
Thanks in advance