-3

这是手稿台

BOOKID  AUTHORID    BOOKNAME            GENRE   NOOFCOPIES  AMOUNT
B105    A102        Diagnosis           Journal     500 10000
B102    A102        The Essence Of Life Fiction     110 11000
B106    A102        Clinical Science    Educational 125 18750
B104    A103        Mind Games          Fiction     200 20000
B100    A102        Sublime             Fiction     100 10000
B101    A105        C Programming       Educational 125 18750
B103    A101        Scribe              Journal     500 10000
B107    A101        Clinical Chemistry  Educational 125 54646
B108    A103        Clinical Chemistry  Educational 125 54646

如何编写查询来检索已出版最少图书数量的作者和作者名列表?

例外的输出是 A105 的详细信息...

4

1 回答 1

0

使用TOP关键字

Select TOP 1 BOOKID,AUTHORID from manuscript ORDER BY NOOFCOPIES ASC

使用子查询

SELECT m.AuthorId, a.AuthorName FROM Author a, Manuscript m WHERE (a.AuthorID = m.AuthorID) AND (m.Numberofcopies IN (SELECT MIN(Numberofcopies) FROM Manuscript));

于 2013-02-08T04:44:35.450 回答