numbering different records of each patient [message #357072] |
Mon, 03 November 2008 15:08 |
schoenif
Messages: 1 Registered: November 2008 Location: Switzerland
|
Junior Member |
|
|
Dear all
I have a table with patient id and several laboratory date per patient (from one to several dozens). I would like to give to each records per patient a observation number in ascending order of the laboratory date. How can I store this in a variable obs.
Need urgent help!!!! I would like to do this with PL/SQL
table looks like this (total of 9000 records):
ID laboratory date obs
112 date1 1
112 date2 2
112 date3 3
115 date1 1
115 date2 2
115 date3 3
115 date4 4
115 date5 5
115 date6 6
|
|
|
Re: numbering different records of each patient [message #357094 is a reply to message #357072] |
Mon, 03 November 2008 22:18 |
bonker
Messages: 402 Registered: July 2005
|
Senior Member |
|
|
Quote: | How can I store this in a variable obs
|
I am assuming OBS is field name in the table and it is not a variable and you need to update this field in the table.
If my assumption is correct then I suggest you need to read documentation on row_number() analytical function and merge command to achieve this.
Updated: Forum guidelines prohibits in providing solution directly so did not provide direct solution to you.
[Updated on: Mon, 03 November 2008 22:20] Report message to a moderator
|
|
|
|
|