2 个表的 3 个值之间的差异
我有 2 个表,例如
id att1 att2
1 34 56
2 45 12
3 34 11
id att1 att2
1 14 10
2 25 2
3 14 10
如何获取 3 个值之间的差异,例如
id att1 att2
1-1=0 34-14=20 56-10=46
2-2=0 45-25=20 12-2 =10
3-3=0 34-14=20 11-10=1
SELECT A.id-B.id, A.att1-B.att1,A.att2-B.att2 from TABLEA as A join TABLEB as B...
I have 2 tables like
id att1 att2
1 34 56
2 45 12
3 34 11
id att1 att2
1 14 10
2 25 2
3 14 10
How to get the diference between the 3 values like
id att1 att2
1-1=0 34-14=20 56-10=46
2-2=0 45-25=20 12-2 =10
3-3=0 34-14=20 11-10=1
SELECT A.id-B.id, A.att1-B.att1,A.att2-B.att2 from TABLEA as A join TABLEB as B...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不会真的想从一个 id 中减去另一个 id,对吗?
You don't really want to subtract one id from another, do you?
不确定您在寻找什么您在问题中尚未提供的内容。你的意思是这样的吗?
Not sure what you're looking for that you didn't already supply in your question. Did you mean something like this?