Grouping rows based on value - pl/sql [message #357397] |
Wed, 05 November 2008 03:38  |
nooruls143
Messages: 8 Registered: March 2008
|
Junior Member |
|
|
Hi,
I have a table with GPS readings. The columns are
ID (primary)
object_id (number)
reading_time (date)
x_coordinate varchar2
y_coordinate varchar2
I am looking for a query where I group the rows as one row based on co-ordinate reading pair. Lets say, I have first 10 rows with same readings and different reading times. The 11th row has different co-ordinate pair. So, the query should return 2 rows with first row indicating the from reading_time to reading_time.
If the 11th reading is different and 12th reading is the same as the first 10 readings, it should display it as a seperate row (3 rows). Can this be done ? If so, I shall be grateful if anyone can provide me a query.
Ta,
Noorul
|
|
|
|
|