This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Counting number of rows returned by select

 
Kim Kantola
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yall,
I am performing a select distinct sql statement in order to get a number of products from a table, I am not really interested in the product names themselves though, but am interested in how many of them there are, for example, if I have a table with rows like this:


And my sql is this:


I get returned the rows:
[B]Apple
Orange
Bannana[B]

But what I am interested in is the fact that there are three of them. Can I add something to the sql to have it return the number of rows returned (3) or do I have to iterate over the result set to find the number?
Thanks a bunch for any info,
Kim
 
nilesh Katakkar
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Select count(distinct FruitName) from PRODUCE
 
Kim Kantola
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks !
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic