On Fri, Jan 1, 2016 at 9:31 PM, Peter Brawley
wrote:
> On 1/1/2016 19:24, Larry Martell wrote:
>>
>> On Fri, Jan 1, 2016 at 2:12 PM, Peter Brawley
>> wrote:
>>>
>>> On 12/31/2015 0:51, Larry Martell wrote:
I need to count the
On Fri, Jan 1, 2016 at 2:12 PM, Peter Brawley
wrote:
> On 12/31/2015 0:51, Larry Martell wrote:
>>
>> I need to count the number of rows in a table that are grouped by a
>> list of columns, but I also need to exclude rows that have more then
>> some count when grouped
On 12/31/2015 0:51, Larry Martell wrote:
I need to count the number of rows in a table that are grouped by a
list of columns, but I also need to exclude rows that have more then
some count when grouped by a different set of columns. Conceptually,
this is not hard, but I am having trouble doing
I need to count the number of rows in a table that are grouped by a
list of columns, but I also need to exclude rows that have more then
some count when grouped by a different set of columns. Conceptually,
this is not hard, but I am having trouble doing this efficiently.
My first counting query
Hi all,
I have a table with ordes and i want to know the top 10 Citys have the most
ordes. This is my table
Order_id, City
Need count the rows where haver the most similar text y the column City?
Thanks all
can u please give sample data.
If the same city has more than one order_id then, you could use this
select city,count(*) total from table group by city order by total desc
limit 10;
regards
anandkl
On 10/1/07, Tomas Abad [EMAIL PROTECTED] wrote:
Hi all,
I have a table with ordes and i
Very well, Works, thanks.
-Mensaje original-
De: Ananda Kumar [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 01 de octubre de 2007 13:16
Para: [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Asunto: Re: Querry Count Rows
can u please give sample data.
If the same city has more than one
Hi SQL-Cracks
How can I count the rows within a select with multiple unions?
Count rows with one select is easy: select count(*) from table
Count rows over multiple tables is complicated:
select name from table1 union select name from table2 union select name from
table3 order by name
Just a note...
Thanks - this did not work for me as I am on 4.0.17 - presumably this
works
on 4.1 (seems to need the SubQuery feature)? If so I will upgrade
immediately!
This isn't a subquery -- this is a Derived Table.
With regards,
Martijn Tonies
Database Workbench - developer tool for
immediately!
From: Yayati Kasralikar [EMAIL PROTECTED]
To: Dave Torr [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to COUNT rows when they have a COUNT in them
Date: Mon, 14 Jun 2004 23:37:15 -0400
Following query does what you want:
SELECT COUNT(*) from (SELECT COUNT(*) as c
PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to COUNT rows when they have a COUNT in them
Date: Mon, 14 Jun 2004 23:37:15 -0400
Following query does what you want:
SELECT COUNT(*) from (c) as temp
-Yayati
Dave Torr wrote:
Probably simple but I can't figure it out!
THe manual section 3.3.4.8
Thanks - that is basically what I used to do (it works fine now on 4.1.2)
but it was very slow as there are a LOT of rows and this method returned all
of them.
From: Garth Webb [EMAIL PROTECTED]
To: Dave Torr [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to COUNT rows when they have
as there are a LOT of rows and this method returned all
of them.
From: Garth Webb [EMAIL PROTECTED]
To: Dave Torr [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to COUNT rows when they have a COUNT in them
Date: Tue, 15 Jun 2004 09:54:19 -0700
You could also try:
SELECT owner
Probably simple but I can't figure it out!
THe manual section 3.3.4.8 has the example
SELECT owner, COUNT(*) FROM pet GROUP BY owner
which is fine. Now what I want to do is count the number of rows this
returns. Actually of course this is trivial - I can just count how many
owners there are.
Following query does what you want:
SELECT COUNT(*) from (SELECT COUNT(*) as c FROM pet GROUP BY owner
HAVING c1) as temp
-Yayati
Dave Torr wrote:
Probably simple but I can't figure it out!
THe manual section 3.3.4.8 has the example
SELECT owner, COUNT(*) FROM pet GROUP BY owner
which is fine.
Thanks - this did not work for me as I am on 4.0.17 - presumably this works
on 4.1 (seems to need the SubQuery feature)? If so I will upgrade
immediately!
From: Yayati Kasralikar [EMAIL PROTECTED]
To: Dave Torr [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to COUNT rows when
: Re: How to COUNT rows when they have a COUNT in them
Date: Mon, 14 Jun 2004 23:37:15 -0400
Following query does what you want:
SELECT COUNT(*) from (SELECT COUNT(*) as c FROM pet GROUP BY owner
HAVING c1) as temp
-Yayati
Dave Torr wrote:
Probably simple but I can't figure it out!
THe manual
On Wed, Jul 02, 2003 at 10:57:18AM -0500, Roy W wrote:
Is there a simple MySQL command that will give a Row Count (# of records)
WITHOUT running a select (huge database)
If it's a MyISAM table, just run a SELECT COUNT(*) FROM table_name.
It's really efficient. Try it. :-)
--
Jeremy D. Zawodny
Is there a simple MySQL command that will give a Row Count (# of records)
WITHOUT running a select (huge database)
Thanks!
Roy
: Wednesday, July 02, 2003 9:57 AM
To: [EMAIL PROTECTED]
Subject: Count Rows?
Is there a simple MySQL command that will give a Row Count (#
of records)
WITHOUT running a select (huge database)
Thanks!
Roy
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
Here's a nice MySQL simple returning records query question!
I want to return a staement saying 'number of records shave been found'
for your
selection.
so presumably this is a simple row count based on the the returning
recordset?
Andrew
Either with PHP or C you can use mysql_num_rows()
Here's a nice MySQL simple returning records query question!
I want to return a staement saying 'number of records shave been
found'
for your
selection.
so presumably this is a simple row count based on the the returning
recordset?
Andrew
Either with PHP or C you can use
Baranowski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 8:39 AM
Subject: Re: Count Rows in two tables
Please forgive me I am new to mySQL, could you give me an example of how I
would do this? The two tables are users and staff
Thanks
Rick
- Original Message
the error
let me know and I will send it to you.
Thanks again
- Original Message -
From: Shyamal Banerjee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 4:29 AM
Subject: Re: Count Rows in two tables
If you know the primary keys of the two tables, it may be done
Hello all,
Does anybody have a SQL string to count the rows in two different tables and
give you a total number of rows? I have been trying to find an answer for a
couple of days and seems like a simple string.
Thank you
Rick
You can't count the join?
Alan
-Original Message-
From: Rick Baranowski [mailto:rickb;baranconsulting.com]
Sent: Wednesday, 13 November 2002 12:10
To: [EMAIL PROTECTED]
Subject: Count Rows in two tables
Hello all,
Does anybody have a SQL string to count the rows in two
On 11/12/02 5:36 PM, Alan McDonald [EMAIL PROTECTED] wrote:
You can't count the join?
Alan
Hello all,
Does anybody have a SQL string to count the rows in two different
tables and
give you a total number of rows? I have been trying to find an
answer for a
couple of days and seems like
Does it have to be in a single query. You could use a Union query and
then total the results in your program.
Select Count(Field1)
From Table1
Union Select Count(Field1)
From Table2;
Rick Baranowski [EMAIL PROTECTED] 11/12/02 5:10:14 PM
Hello all,
Does anybody have a SQL string to count
To: [EMAIL PROTECTED]
Subject: Count Rows in two tables
Hello all,
Does anybody have a SQL string to count the rows in two different
tables and
give you a total number of rows? I have been trying to find an
answer for a
couple of days and seems like a simple string.
Thank you
Ah, yes - sorry
Alan
-Original Message-
From: [EMAIL PROTECTED]
[mailto:murad;godel.bioc.columbia.edu]On Behalf Of Murad Nayal
Sent: Wednesday, 13 November 2002 12:58
Cc: [EMAIL PROTECTED]
Subject: Re: Count Rows in two tables
Alan McDonald wrote:
You can't count
Please forgive me I am new to mySQL, could you give me an example of how I
would do this? The two tables are users and staff
Thanks
Rick
- Original Message -
From: Murad Nayal [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 12, 2002 6:58 PM
Subject: Re: Count Rows
Hello,
I want to know the number of rows in a JDBC-ResulSet just by calling a
function like
it's done in PHP with
mysql_num_rows($result)
There seems to be no such function in the ResultSet interface as
defined in Java 2.
cheers
Oliver Doepner
32 matches
Mail list logo