且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从sql server 2008中的多个表中选择数据

更新时间:2022-11-27 10:29:38

使用内部联接来减少你的问题
Use Inner Join To Reduce Your Problem


请参阅最近的答案,并按照其中提到的链接进行操作:如何获取来自两个表的数据 [ ^ ]
See this recent answer and follow the link mentioned there : How to get data from two tables[^]


您在此处使用的语法称为隐式交叉连接,它毕竟是交叉连接,为此它显示全部可以从您拥有的表中生成数据组合。你有3个表,你会看到数据3次...

你必须了解SQL连接以及如何使用它们...

http://en.wikipedia.org/wiki/Join_(SQL) [ ^ ]

SQL连接的可视化表示 [ ^ ]
The syntax you are using here is called 'implicit cross join' and that IS a cross join after all and for that it displays all combination of data can be produced from the tables you have. As you have 3 tables you see data 3 times...
You have to learn about SQL joins and how to use them...
http://en.wikipedia.org/wiki/Join_(SQL)[^]
Visual Representation of SQL Joins[^]