-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

最小数の本を出版した著者IDと著者名のリストを取得するクエリを作成するにはどうすればよいですか?

除外される出力は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 に答える