加入MSSQL [英] Joins in MSSQL

查看:57
本文介绍了加入MSSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有两张桌子?书? &安培; ?作者?。

我们需要一个查询来检索作者写的所有书籍。

?本书的主键?是bookid,还是作者..它是?作者ID?。

还有另一张桌子?bookdetails?其中包含字段bookid,authorid


请帮助..


谢谢..

There are two tables ?book? & ?author?.
We need a query to retrieve all books written by an author.
Primary key of ?book? is bookid, and of author.. it is ?author id?.
There is another table ?bookdetails? which contains the field bookid, authorid

Kindly help..

Thank You..

推荐答案


有两张桌子?书? &安培; ?作者?。

我们需要一个查询来检索作者写的所有书籍。

?本书的主键?是bookid,还是作者..它是?作者ID?。

还有另一张桌子?bookdetails?其中包含字段bookid,authorid


请帮助..


谢谢..
There are two tables ?book? & ?author?.
We need a query to retrieve all books written by an author.
Primary key of ?book? is bookid, and of author.. it is ?author id?.
There is another table ?bookdetails? which contains the field bookid, authorid

Kindly help..

Thank You..



--------------------------------------------- ----------

您好!

首先考虑表''book''哪个列有bookid,book_name和price ..其中bookid是主键。

然后考虑表''author'',其中包含authorid和author_name列,其中authorid是主键。

然后考虑具有列bookid的table bookdetails ,作者和出版.....我只是假设好了!

现在我们想要检索作者所说的所有书籍,说他的作者是1 .....然后查询如下....你改变了authorid accd给你!


查询如下:

-------------------------------------------------------
Hello !
First consider table ''book'' which has columns bookid, book_name and price.. out of which bookid is primary key.
Then consider table ''author'' which has columns authorid and author_name out of which authorid is primary key.
Then consider table bookdetails which has columns bookid, authorid and publication..... i just assumed ok !
Now we want to retrieve all the books wriiten by an author say his authorid is 1 ..... then the query goes as follows.... you change the authorid accd to you !

query as follows :

展开 | 选择 | Wrap | 行号


hi,



展开 | 选择 | Wrap | 行号


亲爱的,

你的代码是
Dear,
Your code is
展开 | 选择 | Wrap | 行号


这篇关于加入MSSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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