我想在给定日期和其他标准之间获得卡号的最后一笔交易。
Select * from table WHERE date <= '6/30/2012' and Type = 'D'
数据:
CardNumber FirstName Date Type 1 John 11/01/2013 F 1 John 10/14/2013 D 1 John 05/01/2012 D 2 Paul 04/01/2012 D 2 Paul 05/15/2013 F 2 Paul 01/01/2012 D
结果:
CardNumber FirstName Date 1 John 05/01/2012 D 2 Paul 04/01/2012 D