|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
select
a.trade_id,
a.subscribe_time,
a.trade_id,
a.cancel_type,
a.operator_type,
a.operator_time
from dbo.tbl_subscribe_total a
inner join
(
select trade_id,max(operator_time) operator_time
from dbo.tbl_subscribe_total
where operator_type <> '2' and operator_time <= '2010-04-15'
group by trade_id) b
on a.trade_id = b.trade_id and a.operator_time = b.operator_time
where a.operator_type <> '2' and (a.cancel_type <> '00' or a.cancel_type is null)
and a.subscribe_time <= '2010-04-15'
operator_time <= '2010-04-15' 这个值 是 动态变化的,
与 subscribe_time <= '2010-04-15'相同
|
|