RE: limit stop count

2004-03-17 Thread Rogers, Dennis
SELECT COUNT(*) FROM tbl WHERE where_clause limit 200;

-Original Message-
From: Lorderon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 6:45 PM
To: [EMAIL PROTECTED]
Subject: limit stop count


How can I limit a count to stop when he reaches 200 rows?

SELECT COUNT(*) FROM tbl WHERE where_clause;=> returns 3500

I want to stop the counting when it reaches to 200, so MySQL will not search
further to count all the 3500 rows..


thanks,
-Lorderon.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


RE: Query help - add results then divide by

2004-02-25 Thread Rogers, Dennis
Thanks so much!!

SELECT (SUM(( ads.col * 1.91)  * ads.depth ) / 131.77) * 100
FROM ads
WHERE date = '2004-02-26'
AND editionID = '13'
AND ads.page = '16'

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 5:55 PM
To: Rogers, Dennis
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; Hines," David
Subject: Re: Query help - add results then divide by 


What about 
SELECT (SUM( ads.col * 1.91)  * ads.depth ) ) / 131.77
FROM ads
WHERE date = '2004-02-26'
AND editionID = '13'
AND ads.page = '16'


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 2/25/04, 4:19:12 PM, "Rogers," Dennis <[EMAIL PROTECTED]> wrote 
regarding Query help - add results then divide by :


>   Good afternoon,

>   How can I take the 3 results below add them together then divide
> by
> 131.77?

>   Can it all be done in one SQL statement?

>   Thanks in advance.

>   mysql> describe ads;
>   
> +---+---+--+-+++
>   | Field | Type  | Null | Key | Default| Extra
> |
>   
> +---+---+--+-+++
>   | adID  | int(11)   |  | PRI | NULL   |
> auto_increment |
>   | page  | int(11)   |  | | 0  |
> |
>   | adnum | varchar(20)   |  | ||
> |
>   | date  | date  |  | | -00-00 |
> |
>   | depth | decimal(3,2)  | YES  | | 0.00   |
> |
>   | timestamp | timestamp(14) | YES  | | NULL   |
> |
>   | col   | int(11)   | YES  | | 0  |
> |
>   | acc   | varchar(50)   |  | ||
> |
>   | editionID | int(11)   |  | | 0  |
> |
>   
> +---+---+--+-+++
>   9 rows in set (0.00 sec)

>   mysql> SELECT ((ads.col * 1.91)  * ads.depth)  FROM ads Where
> date =
> '2004-02-26' AND editionID = '13' AND ads.page = '16';
>   +-+
>   | ((ads.col * 1.91)  * ads.depth) |
>   +-+
>   |7.64 |
>   |   34.38 |
>   |7.64 |
>   +-+
>   3 rows in set (0.01 sec)


Query help - add results then divide by

2004-02-25 Thread Rogers, Dennis

Good afternoon,

How can I take the 3 results below add them together then divide by
131.77?

Can it all be done in one SQL statement?

Thanks in advance.

mysql> describe ads;

+---+---+--+-+++
| Field | Type  | Null | Key | Default| Extra
|

+---+---+--+-+++
| adID  | int(11)   |  | PRI | NULL   |
auto_increment |
| page  | int(11)   |  | | 0  |
|
| adnum | varchar(20)   |  | ||
|
| date  | date  |  | | -00-00 |
|
| depth | decimal(3,2)  | YES  | | 0.00   |
|
| timestamp | timestamp(14) | YES  | | NULL   |
|
| col   | int(11)   | YES  | | 0  |
|
| acc   | varchar(50)   |  | ||
|
| editionID | int(11)   |  | | 0  |
|

+---+---+--+-+++
9 rows in set (0.00 sec)

mysql> SELECT ((ads.col * 1.91)  * ads.depth)  FROM ads Where date =
'2004-02-26' AND editionID = '13' AND ads.page = '16';
+-+
| ((ads.col * 1.91)  * ads.depth) |
+-+
|7.64 |
|   34.38 |
|7.64 |
+-+
3 rows in set (0.01 sec)



RE: mysql Digest 16 Jun 2003 00:46:21 -0000 Issue 2497

2003-06-15 Thread Rogers, Dennis
How do I unsub from this list? The unsub link doesn't work?



}
echo("Quick it's all most closing time!!!");
more_help();
?> 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Sunday, June 15, 2003 8:46 PM
To: [EMAIL PROTECTED]
Subject: mysql Digest 16 Jun 2003 00:46:21 - Issue 2497



mysql Digest 16 Jun 2003 00:46:21 - Issue 2497

Topics (messages 142726 through 142766):

howto store files in mysql
142726 by: Joe Baptista
142731 by: Becoming Digital

Re: Machine requirements
142727 by: Curtis Maurand

Re: PHP, MySQL and Apache
142728 by: Curtis Maurand
142729 by: Curtis Maurand

Re: soft real-time database
142730 by: Curtis Maurand

HELP!!! permissions not working!
142732 by: Timothy Waters
142765 by: Becoming Digital

Re: PHP, MYSQL and persistant authentication
142733 by: Daevid Vincent

Just a test
142734 by: Scott Haneda

Question about INSERT vs UPDATE
142735 by: Shane Bryldt
142742 by: Becoming Digital
142743 by: Shane Bryldt
142756 by: Becoming Digital
142759 by: Shane Bryldt

SELECT... EXCEPT FOR
142736 by: Jed Hunsaker
142741 by: Becoming Digital

Re: DATE
142737 by: Don Read

What does the ERROR mean?
142738 by: Ares Liu

[BUG] show full processlist on AIX
142739 by: Ares Liu

Re: Impossible query??
142740 by: Michael Scott

Two Table Query
142744 by: "" 
or click:
http://lists.mysql.com/[EMAIL PROTECTED]

To post to the list, e-mail:
<[EMAIL PROTECTED]>


--



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]