在SQL中将表单与两个不同表连接 [英] Connecting a Form with two diffrent table in SQL
问题描述
亲爱的所有我正在尝试为书本公司创建软件...
但是问题是我无法连接到SQL中两个表的数据....
格式就像这样...书的ISBN是主键.
在一张桌子上,我有isbn,书名,价格.
还有另一个表我有isbn,isbn的创建者.....
团队要求是一种他们想知道哪个isbn,title是由谁创建的形式.因此,基于isbn,我必须从两个不同的sql表中获取数据,并以Windows形式以1.ISBN,2.TITLE,3.PRICE,4.CREATE BY的单一形式显示.
亲爱的朋友,请忽略英语错误,请帮助我创建此页面.......
在此先感谢....
Dear all i am trying to create a software for a book tread company...
But the problem is i am not able to connect to fatch the data from two table in sql....
format is like this ... book ISBN Is the primary key.
in one table i have isbn , book name , price.
and the another table i have isbn , creator of isbn.....
the componey requirement is in one form they want to know which isbn,title is created by whom. so on the bases of isbn i have to fatch data from two diffrent table of sql and in windows form show in a single form like 1.ISBN, 2.TITLE, 3.PRICE, 4.CREATE BY.
Dear friend please ignore the English Mistake and pleae help me to create this page .......
thanks in advance....
推荐答案
要从两个不同的表中获取数据,可以使用联接查询:
如果第一个表名称:第一和第二个表名称:第二
选择first.isbn,first.bookName,first.price,second.creator
从第一开始
内联第二
开启first.isbn = second.isbn
如果不满意,请再次清除您的问题.
To fetch the data from two different tables You can use the join queries:
If first table name: first and second table name: second
SELECT first.isbn, first.bookName, first.price, second.creator
FROM first
INNER JOIN second
ON first.isbn=second.isbn
If not satisfied please clear your question again.
这篇关于在SQL中将表单与两个不同表连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!