高级SQL查询 [英] advanced sql query

查看:54
本文介绍了高级SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表我想要一个查询来编译两个表的列,如下所示

tabel a

extnam   金额

extnam    amount

amir         10

amir         10

amir          20

amir          20

maged     13

maged     13

noha       12

noha       12

alie          43

alie          43

tabel b

extnam    purch

extnam    purch

amir         40

amir         40

amir          20

amir          20

maged     20

maged     20




我读过这个主题,无法执行查询 

stackoverflow

stackoverflow

sql result want 

sql result want 

extnam   量      purch

extnam    amount      purch

amir          30              60

amir          30              60

maged     13                20

maged     13                20

noha       12

noha       12

alie          43

alie          43

推荐答案

Monemas

Monemas

最了解这一点的人在SQL Transact论坛中。如果您有SQL transact,您可以在dataadapter中使用它来获取连接表。 

The persons who know the most of this are in the SQL Transact forum. If you have the SQL transact you can use that in a dataadapter to get a joined table. 

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql

你问题中的VB部分是我认为你已经多次完成的事情。 

The VB part in your question is something which in my perception you have done already many times. 


这篇关于高级SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆