关于如何调用数据库中的数据,是否有任何教程 [英] Is there any tutorial regarding on how to call data in database

查看:114
本文介绍了关于如何调用数据库中的数据,是否有任何教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有几个问题.我知道使用1个表我可以调用其所有列
示例:
从[tbl1]中选择*"

但香港专业教育学院有一个问题
如果香港专业教育学院有很多席位,并且他们有关系,该怎么办?的唯一标识符是[1],因为所有表都具有[1],我认为这是它们的主键

是否有任何教程可以使用sigle查询调用所有这些教程?
还是可以向我提供查询字符串?

即时通讯使用SQLServer 2005

在此先感谢您,还有更多功能..

Hi guys, a got a few question. I know that using 1 table i could call all its column
EXAMPLE:
"Select * from [tbl1]"

but ive got a problem
what if ive got a lot of table and they are in a relationship. The unique identifier for the is [1] cause all of table have [1] and i think it is their primary key

is there any tutorial where i can call all of them using a sigle query?
or could you provide me the query string?

by the way im using SQLServer 2005

Thanks in advance and more power..

推荐答案

您可以使用JOIN来执行此类任务.如果您只是在Google中搜索,实际上有很多教程.其中一些在下面

SQL连接 [ ^ ]
SQL连接教程 [ SQL连接 [ ^ ]
You can use JOIN to do this kind of task. There are actually a lot of tutorials if you just search in google. Some of them are below

SQL Joins[^]
SQL Join Tutorial[^]
SQL Join[^]


您可以使用INNER JOIN

You can use INNER JOIN

Select T1.*,T2.* from [tbl1] T1 INNER JOIN [tbl2] T2 ON T1.ID = T2.ID



谢谢,
Imdadhusen



Thanks,
Imdadhusen


这篇关于关于如何调用数据库中的数据,是否有任何教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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