INTO clause expected in SELECT statement
738256Dec 2 2009 — edited Dec 2 2009Hi all,
I have this pl sql code that errors out:an INTO clause is expected in this SELECT statement.
Code
Declare
prev_col1 FLOAT(10) := 0;
temp3 temp2%rowtype;
Begin
select * from
(
select col1, col2, col3,
lag(col1,1,0) over(order by rownum) prev_col1
from temp2 where <conditions here> order by col2
)
where col1- prev_col1 > 10000 and col1>0 and prev_col1>0;
End;
I have tried in vain to use select into, with both the select statements(separately). Please advise.
Basically, I am comparing a field with the previous field and identifying faulty fields. Then I want to replace the faulty field with the previous field.