select
*
from
(
select
* ,rn=ROW_NUMBER()over(partition
by
BarCode
order
by
[
Time
])
from
t
) tt
where
tt.rn=1
)
select
*
from
(
select
* ,rn=ROW_NUMBER()over(partition
by
BarCode
order
by
[
Time
])
from
t
) tt
where
tt.rn=1
)