![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: |
#3
| |||
| |||
|
|
I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: |
#4
| |||
| |||
|
|
I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: |
#5
| |||
| |||
|
|
I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: |
#6
| |||
| |||
|
|
sheldonlg wrote on 21.05.2008 22:51: I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: http://download-uk.oracle.com/docs/c...0.htm#i1327527 |
#7
| |||
| |||
|
|
sheldonlg wrote on 21.05.2008 22:51: I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: http://download-uk.oracle.com/docs/c...0.htm#i1327527 |
#8
| |||
| |||
|
|
sheldonlg wrote on 21.05.2008 22:51: I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: http://download-uk.oracle.com/docs/c...0.htm#i1327527 |
#9
| |||
| |||
|
|
sheldonlg wrote on 21.05.2008 22:51: I want to add FP_ENDDT where ENDDT is either the last day before the next period or the beginning of the next period. I don't really care which, since I will either use "<" or "<=" for the date range. This table is built from another one that the three fields above. What I want to know is whether it is possible, using that reference table, to build my table and have ENDDT populated by looking at the next (or previous) row. All my sql experience has been with a single row or from the entire table. I don't know if it is possible to reference the adjacent row. Have a look at the lag() function, that's what you are looking for: http://download-uk.oracle.com/docs/c...0.htm#i1327527 |
![]() |
| Thread Tools | |
| Display Modes | |
| |