SQL语句,同一个表中,两个字段相减,应该怎么写?

如题所述

第1个回答  2020-02-06
楼主你的数据我已原样转化到本地数据库,通过我编写的sql
查询出来了。我可确定是你要的效果。
select
a.id,
a.num,
a.time,
isnull(
datediff(
[minute],
(
(select
top
1
time
from
test
where
num
=
(
select
num
from
test
where
id=a.id
)
and
id

评论
0

0

0

加载更多