Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 11:28 AM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default finding total no. of records

I have fields "Singer","Song" in a Table "Album"

Now i want to run a combination of SQL Query & other functions combined so that i finally get hold of the total no. of songs sung by each different Singer existing in the "singer" field

i tried using RecordCount propert of Recordset but it dint work out.

how do i do this.

i posted this in the how-to section, but no-ones answering. mebe its too simple as im newbie to asp. or wrong forum

 
Old July 24th, 2003, 01:01 PM
uit uit is offline
Authorized User
 
Join Date: Jul 2003
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Greetings -

You might be able to check the RecordCount property of your recordset.

Please note that in some cases you wont be able to grab the # of records from that property. You should review this info to help you learn more about this topic: http://www.aspfaq.com/show.asp?id=2193

Hope that helps you....

 
Old July 24th, 2003, 02:05 PM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx for getting me on with the recordcount. But i still havnt solved my problem.

The idea is to look for how many entries each singer has got without supplying the singers name, that is first i've to find out what allare the names of singers in the database and then find of no. records of each singer.

How do i do that ? I need some more help regarding that.

 
Old July 24th, 2003, 02:22 PM
uit uit is offline
Authorized User
 
Join Date: Jul 2003
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I see what you are saying now, sorry about the confusion...

You are most likely looking for a count per singer of the number of songs for each.

Try this:

SELECT SINGER, COUNT(*) FROM ALBUM GROUP BY SINGER

For more info on "GROUPING" - check out www.sqlteam.com - they have a pretty decent site. The Wrox books are very good too.

 
Old July 24th, 2003, 06:35 PM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanx that has solved my problem now






Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Get total records europhreak Classic ASP Basics 10 February 5th, 2006 02:12 PM
how to find total no. of records reshmisworld Classic ASP Basics 1 July 24th, 2003 08:04 PM
finding total no. of records reshmisworld Classic ASP Databases 1 July 24th, 2003 03:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.