Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
| Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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
  #1 (permalink)  
Old April 17th, 2004, 05:04 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

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

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!!


  #2 (permalink)  
Old April 18th, 2004, 02:48 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Code:
SELECT Count(Featureid)
FROM urTable
GROUP BY Featureid
Always:),
Hovik Melkomian.


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 SQL Language 1 April 17th, 2004 07:30 PM





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