473,614 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

count number of rows returned

19 New Member
hi
i am using the select query with group by, so that i am getting records with more than one column so that i need to calculate the number of rows returned by the query for example

with my select ..group by i get the result as follows
userid count(*)
101 12
105 13
100 10
34 6
but i need to calculate number of rows returned so that my result is 4 kindly specify me with example
regards
yuvaraj
Jul 4 '08 #1
2 4735
Dekudude
9 New Member
Do you want to count the number of rows returned, or do you want to limit it to only 4, so no more show up? If the latter, add "LIMIT 4" after "GROUP BY `` "
Jul 4 '08 #2
yuva17raj
19 New Member
hi
thanks for the reply and i have got the result by using this example query
select count(*) from(select distinct(userid ),max(mark) from testtable groupby userid having mark > 90) as single
regards
yuvaraj
Jul 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
11208
by: leegold2 | last post by:
Below is some code from a FULLTEXT search. My question is how do I get a count of the number of rows found by the search? $query="SELECT * FROM balloon_txt WHERE MATCH(access_no, recs_txt) AGAINST ('meteorology')"; $result = MySQL_query($query);
3
108613
by: Prem | last post by:
To all gurus, I am developing an application in which i want to show the number of rows returned by the query. e.g. Select Categories.CategoryName, Products.ProductName, Sum((.UnitPrice**(1-)/100)*100) AS ProductSales FROM ((( INNER JOIN Orders ON .OrderID = Orders.OrderID)
2
1593
by: Gregory.Spencer | last post by:
Help, I have a query in MySQL which gets the details of members of a club. e.g. Select * from members. however, in the same query I want to return the amount of "functions" the member has attended. therefore there is a "functions" table and because functions has a
4
1218
by: kjc | last post by:
Is it possible to obtain a count of the number of rows that would be returned based on the following query. select tableA.*, tableB.fieldA, tableB.fieldB, tableB.fieldC, tableC.fieldA, tableD.fieldA, tableD.fieldB
10
3725
by: Zak McGregor | last post by:
Hi all is it possible to get a count(1) statemment, for example here: select count(1) from results where fixture=4916 and winner=away group by winner; to return a 0 value instead of absolutely nothing if no rows match fixture=4916 and winner=away? I get absolutely no results at all.
5
2036
by: Dev | last post by:
Hello all, I am trying to get a total number of rows returned form a query. SELECT count(this) from table group by this Currently it is returning x rows with a count of each of the group by. I need the count of the rows returned!
68
6791
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
2
9070
by: John | last post by:
Hi I am using the below statement; Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable) How can I now check the record count of the data table and specifically if the record count returned by fill is not 0? Thanks
4
3770
by: whatsuppussycat | last post by:
I want to be able to SUM the values returned using the TOP 5 and COUNt statements. So far I've tried from many angles and can't get it to work, very frustrating! Here is my code: SELECT TOP 5 WITH TIES eworkCalls.Category,eworkCalls.SubCategory, ClStandingdata.tblRoutes_AREA AS Route, ClStandingdata. AS BinDay, eworkcalls.sla as SLA, COUNT(*) AS FROM cleansing, eworkcalls LEFT OUTER JOIN clstandingdata ON...
0
8130
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5540
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.