List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:April 11 2001 1:34pm
Subject:Re: How to get it in ONE query?
View as plain text  
Why?
The mysql monitor is not a programming language.
You are going to write programs in perl, PHP, python, or some other
program that will be able to tell you how many rows were returned.

Besides, if you look your output, it tells you how many rows were
returned.
Parse it.

michalm wrote:
> 
> I need to get information about number of all rows produced by query 1)
> and information produced by limited query 2).
> I can do this in these 2 queries.
> |---------------------------|
> |How to get it in ONE query?|
> |---------------------------|
> 1)
>   mysql> SELECT count(*) FROM  t_what WHERE price<25;
>   +----------+
>   | count(*) |
>   +----------+
>   |       25 |
>   +----------+
>   1 row in set (0.00 sec)
> 
> 2)
>   mysql> SELECT what_oid, what_pl_name FROM t_what WHERE price<25 LIMIT 0,10;
>   +----------+--------------+
>   | what_oid | what_pl_name |
>   +----------+--------------+
>   |        1 | Misja        |
>   |        2 | System       |
>   |        3 | Clueless     |
>   |        4 | Fortepian    |
>   |        5 | Sebastian    |
>   |        6 | Carrington   |
>   |        7 | Casablanca   |
>   |        8 | Dziwne dni   |
>   |        9 | Wyliczanka   |
>   |       10 | Mozarella    |
>   +----------+--------------+
>   10 rows in set (0.02 sec)
> ----------------------------------------
>  Michael Mierzejewski                        mailto:michalm@stripped
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread71217@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Thread
How to get it in ONE query?michalm11 Apr
  • Re: How to get it in ONE query?Gerald Clark11 Apr
  • Re: How to get it in ONE query?Jan Dvorak12 Apr