ANY dialect question:
Rows to String
I have a database that I am trying to turn row records into a string.
For example, the records look like this
R# ID# Bg Dt Ed Dt Cde
1 1001 1/1/07 2/5/07 H
2 1001 2/5/07 5/5/07 P
3 1001 8/7/07 10/1/07 S
4 1002 2/1/07 3/4/07 P
5 1002 5/1/07 6/2/07 J
6 1002 6/2/07 7/7/07 P
and would like to get a query result that looks like this:
1001 HP0S
1002 P0JP
where zeros indicate that the time is not continuous, or gap in service.
I looked at concatenating rows...but I don't think that is exactly what I need. Any suggestions?
|