Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to display 3 records of a database?

Reply
Thread Tools

How to display 3 records of a database?

 
 
Steven Spits
Guest
Posts: n/a
 
      06-04-2004
Hi,

> Basicly i want to display the names of the authors that published more
> books.


This is the SQL statement you need:

SELECT TOP 3 Author, COUNT(Author) AS Total
FROM Books
GROUP BY Author
ORDER BY Total DESC

With kind regards,

Steven Spits

- - -


 
Reply With Quote
 
 
 
 
Miguel Dias Moura
Guest
Posts: n/a
 
      06-05-2004
Hello,

I am working in and ASP.net / VB web site with Access database. I have a
database of books with the following fields:

PrimaryKey; Book Title; Author

I want to display in a web page the names of the 3 Authors which appear more
often in the database.
Basicly i want to display the names of the authors that published more
books.

John Smith - 21 Books Published
Mary Dias - 15 Books Published
Jack Slater - 12 Books Published

Can you help me out?

Thank You Very Much,
Miguel


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple query returns 0 records in asp, but all records in vbscript masg0013@gmail.com ASP General 3 11-02-2006 09:23 AM
How to display records according to this rule? Miguel Dias Moura ASP .Net 5 12-09-2004 09:28 AM
RE: Datagrid wont display records by default =?Utf-8?B?QmluIFNvbmcsIE1DUA==?= ASP .Net 1 05-10-2004 09:51 PM
Delete records or update records Dan ASP General 1 05-10-2004 01:25 PM
match muliple header records to associated detail records Luke Airig XML 0 12-31-2003 12:06 AM



Advertisments