Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Data Correction for - Efficient Select statement need
Folks
thanks to those of you who replied with good solutions, but due a mistake on my behalf, the solutions will not produce the correct result.
I have modified the data correctly below.
results:
What I need to do is SELECT everything from table T, but only SELECT one column for records that have consecutive values of A and equal values of B, C and D, and show the start and finish values of A as well as the values of B, C and D.
the problem with the min and max solution is that if table T above also contained the column
the then results would be
instead of
here is a create statement to set up the table T
create table T
(A number, B varchar2(2), C varchar2(3), D varchar(2));
insert into T values (1, 'x', 'y', 't'); insert into T values (2, 'x', 'y', 'z'); insert into T values (3, 'x', 'y', 'z'); insert into T values (4, 'x', 'y', 'z'); insert into T values (6, 'x', 'y', 'z'); insert into T values (7, 'a', 'b', 'c'); insert into T values (8, 'a', 'b', 'c'); insert into T values (9, 'x', 'b', 'c');
Thank you
Colin Woods. Received on Fri May 22 1998 - 09:41:52 CDT