如何检查表中的条目是否链接到另一个选项卡; e [英] How to check if entry in table linked to another tab;e

查看:49
本文介绍了如何检查表中的条目是否链接到另一个选项卡; e的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是一名初学者,对mySQL查询有疑问.我有2个表"t1"和"t2". t1中有5个条目,而t1中的每个条目都有t2中的5个条目.如何使用MySQL查询检查t2中的条目是否链接到t1中的条目?预先感谢您.

解决方案

u可以通过大量联接来检查它
选择要使用的是您的工作!


http://www.tizag.com/mysqlTutorial/mysqljoins.php [ http://phpweby.com/tutorials/mysql/32 [ http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php [ ^ ]


两个表具有相同记录或多少记录都无关.
如果在创建表列之间存在某种关系,那么只能说表已链接
像主键和外键
http://www.w3schools.com/sql/sql_foreignkey.asp

或第一个表格和列中的列第二张表与等价关系.
例如第一张桌子的员工
列-Empid empname depid
第二表部门
列-deptid deptname
这两个表与deptid链接

假设第一个表只有这两列
Empid empname则两个表之间没有关系.(我看不到这种情况)
您应该首先了解要提供的功能,然后再根据数据库设计进行了解.然后,您将获得表之间的链接.
请通过此链接进行数据库表中的关系设计.
http://parallel.vub.ac.be/documentation/database/tutor/

Hi all i am a beginner programmer and have a problem with a mySQL query. I have 2 tables ''t1'' and ''t2''. There are 5 entries in t1 and for each entry in t1 there 5 entries in t2. How can i check if the entries in t2 are linked to entries in t1 using a mySQL query? Thanking you in advance.

解决方案

u can chechk it with lots of joins
it is your work to select wich u will use!


http://www.tizag.com/mysqlTutorial/mysqljoins.php[^]

http://phpweby.com/tutorials/mysql/32[^]

http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php[^]


It is no matter that both table having same record or how much record.
If there is some relation between table column is created then only you can say tables are linked
Like Primary key & foreign key
http://www.w3schools.com/sql/sql_foreignkey.asp

Or column from first table & second table are having some relation for eqality.
E.g first table Employee
column - empid empname depid
second table Dept
column - deptid deptname
Here two tables are linked with deptid

Suppose first table having only these two column
empid empname then there is no relation between two table.(I dont see such situation)
You should understand first what functionality you are providing then according to see database design. Then you get link between tables.
Please go through this link for relational design in database table.
http://parallel.vub.ac.be/documentation/database/tutor/


这篇关于如何检查表中的条目是否链接到另一个选项卡; e的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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