retrive the the data which modified in specific column along with secong max updated date in sybase sql

时间:2017-05-16 09:17:50

标签: sybase-ase sybase-iq

I have the data column name status1 status2 status3 update_date user Row1 A 1 2 3 06/05/2017 A Row2 A 1 3 3 05/05/2017 C Row3 A 5 2 3 03/05/2017 A Row4 A 2 3 3 02/05/2017 B Row5 A 2 2 1 01/05/2017 A

THE EXPECTED RESULT IS:

i want to retrive the data modified in status1(specific) and its last modified date along with before modification which data it had on specific date(04/05/2014) Ex:

Row3 A 5 2 3 03/05/2017 A Row4 A 2 3 3 02/05/2017 B

as you can see in row 3 the status1 lastly updated on 03/05/2017 by the user A (I want this data) as well as in row 4 before the update it had a data of row 4

could you help me on this?

0 个答案:

没有答案