Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 17th, 2004, 04:59 PM
Registered User
Join Date: Mar 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to programmer_kay
Default SQL query for count

   I have two tables as table1(featureid) and table2(featureid). The difference is table1 has duplicate records of feature ids like
and table 2 has unique set of featureids

So, now I want something which counts how many entries of a particular featureid are there in table1. i.e.

featureid count
  1 2
  2 1

How can I do this.
 Any help is appreciated. Thanks!!

Reply With Quote
  #2 (permalink)  
Old April 17th, 2004, 07:30 PM
Friend of Wrox
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Is this what you are looking for?

select featureid, RowCountValue=count(*) from Table1
group by featureid order by featureid

Hope that helps.


-Vijay G
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
new display count query carswelljr SQL Language 9 May 7th, 2007 04:59 PM
SQL count query not giving correct results hman SQL Language 2 March 16th, 2005 07:06 AM
SQL count query not giving correct results hman SQL Server 2000 1 March 15th, 2005 01:15 PM
query count? Raif Access 1 June 18th, 2004 05:08 PM
SQL query for count programmer_kay ADO.NET 1 April 18th, 2004 02:48 AM

All times are GMT -4. The time now is 01:31 PM.

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