Skip to Content
0
Feb 26, 2009 at 03:28 PM

Previous Record Using Select statement.

471 Views

Hi,

Is it possible using Select statement to retrieve the previous Record. For Example:-

I have two Tables Header and Item Tables

In the Header table "AAAA" I have 1 Record

MATNR

MaterialA

In the Item table "BBBB I have 2 Records

MATNR PRICE

MaterialA 20

MaterialA 30

Now using the select statement I want 1 output. The output should be as below just on 1 line

MATNR Current Price Previous Price

MaterialA 30 20

Hope that makes sense. I am ok with getting the current price as this is easy enough using the select * statement and it will bring the last record.

The Question is how can i obtain the Previous Price using the above as an Example?

Thanks

Adeel