如何在DB2中获取特定记录以及后续记录

时间:2015-03-19 11:34:38

标签: db2

我有以下数据

EmpName .... .... EMP_ID日期..........状态

Adam............0001.........1 january.....Active

Adam............0001.........2 january.....Active

Adam............0001.........3 january.....Absent

Adam............0001.........4 january.....Active

Adam............0001.........5 january.....Active

Adam............0001.........6 january.....leave

Adam............0001.........7 january.....Active

Adam............0001.........8 january.....active

Adam............0001.........9 january.....absent

Adam............0001.........10 january....Active

我想要状态未激活的记录,以及状态为活动状态的免费跟踪记录..所以我想要的数据应该是

EmpName....Emp_ID....Date..........Status


Adam............0001.........3 january.....Absent

Adam............0001.........4 january.....Active

Adam............0001.........6 january.....leave

Adam............0001.........7 january.....Active

Adam............0001.........9 january.....absent

Adam............0001.........10 january....Active

怎么做?

0 个答案:

没有答案