使用数据库中的多个表 [英] Using multiple tables from a database

查看:73
本文介绍了使用数据库中的多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在编写查询语句时遇到问题,从不同的表中选择不同的列,以显示在我在excel文件上制作的发票上。我有一个问题的原因是因为我使用c-sharp和编码起初有点复杂...如果有人遇到这个问题或者可能知道如何解决它,我很想听听你的输入。

PSIm使用visual studio 2005以防编码可能不同


George

Hi,
Im having problems writing a query statement to select different columns from different tables to display on an invoice i made on an excel file. The reason i have a problem is because im using c-sharp and coding is a bit complicated at first...if anyone has ran into this problem or may know how to solve it, i would love to hear ur input.
P.S.Im using visual studio 2005 in case the coding may differ

George

推荐答案

如果你想加入来自不同表格的数据,您可以在存储过程中执行此操作。


这是一个示例:

If you are looking to "JOIN" data from different tables you can do this within your stored procedure.

Here is an Example:

展开 | 选择 | Wrap | 行号





我在编写查询语句时遇到问题,从不同的表中选择不同的列来显示我在excel文件上发的发票。我有一个问题的原因是因为我使用c-sharp和编码起初有点复杂...如果有人遇到这个问题或者可能知道如何解决它,我很想听听你的输入。

PSIm使用visual studio 2005以防编码可能不同


George
Hi,
Im having problems writing a query statement to select different columns from different tables to display on an invoice i made on an excel file. The reason i have a problem is because im using c-sharp and coding is a bit complicated at first...if anyone has ran into this problem or may know how to solve it, i would love to hear ur input.
P.S.Im using visual studio 2005 in case the coding may differ

George



你使用SQL查询数据库,而不是像C#或VBNET这样的编程语言。

您使用的代码是什么?

You use SQL to query databases, not a programming language like C# or VBNET.
What are you using for your code?



您使用SQL查询数据库,而不是像C#或VBNET这样的编程语言。

您使用的代码是什么?
You use SQL to query databases, not a programming language like C# or VBNET.
What are you using for your code?



我已经尝试将sql查询插入到应该执行此过程的命令中,例如:


SELECT GuestFirstName FROM Guest WHERE ToGuestInvoice> 0


但它会在FROM和WHERE上出错,因为它无法识别它。如果这个后面的代码可以工作,我就不会有任何问题...也许它有一个程序集或某些东西我不知道但我怀疑它。也许你可以开导我......真的很感激。


George

Well I''ved tried inserting sql queries into the commands that are supposed to carry out the procedure like this for example:

SELECT GuestFirstName FROM Guest WHERE ToGuestInvoice > 0

But it gives errors on FROM and WHERE because it doesn''t recognize it. If this behind code would work I wouldn''t have any problems...maybe it has an assembly or something im missing but I doubt it. Maybe u can enlighten me...Would really appreciate it.

George


这篇关于使用数据库中的多个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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