Behrang Saeedzadeh wrote:
Hi,
Suppose that there are two tables book and author:
book
id
title
author_id
author
-
od
title
I want a query that returns all the books, but if there are more than
3 books with the same author_id, only 3 should be returned. For
example if this is
Hi Behrang,
Behrang Saeedzadeh wrote:
Hi Baron,
Thanks. That that worked great. Is it possible to insert an empty row
after the books by the same author?
-Behi
On 4/12/07, Baron Schwartz [EMAIL PROTECTED] wrote:
Behrang Saeedzadeh wrote:
Hi,
Suppose that there are two tables book and
Hi Baron,
Please remember to reply to the list so others can read and benefit from
answers to
your questions. Also, though I don't care tremendously one way or another,
many people
think it's good form to place your response after the message instead of before
(I tend
to follow the pattern
Not sure how to do it in a single query, but if you run this query repeatedly,
eventually you'll have only 10 left of each category.
DELETE tableName
FROM tableName, (SELECT MAX(ID) deleteID,count(ID) categCount FROM tableName GROUP BY Category HAVING categCount10) AS Smry WHERE
Hi Abhishek,
In a table i have 100s of rows with six categories like A,B,C,D,E,F
which is
marked with a column like
Table
ID Category
1 A
2 A
3 B
4 B
5 B
6 C
7 C
and so on 100 ids for each of six categories , i want to delete all
but 10
ids of each category, i wanted to know how to
I'm not sure this will work for you, but look at the GROUP BY clause and the
GROUP_CONCAT() function.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
-Original Message-
From: Jesse [mailto:[EMAIL
I'm not sure this will work for you, but look at the GROUP BY clause and
the
GROUP_CONCAT() function.
That was exactly what I needed! I converted my query as follows, and I'm
getting exactly what I was looking for:
SELECT S.*, CONCAT(C.FirstName,' ',C.LastName) AS CounselorName,
(SELECT
At the moment we are using mysql 3.23.58. It would appear I can't use UNION
in this version ?
Do I have any other options, without upgrading the database server version ?
Regards,
Neil
From: Nils Jünemann [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Query Two Databases
Date
. It would appear I can't use UNION
in this version ?
Do I have any other options, without upgrading the database server version ?
Regards,
Neil
From: Nils Jünemann [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Query Two Databases
Date: Thu, 25 Jan 2007 12:01:48 +0100
-BEGIN PGP
Neil Tompkins wrote:
Following on from the email below, if I run the query
SELECT * FROM database1.table, database2.table
I get the data back, but all the data is in the same row.
How can I seperate the records ?
Regards
Neil
Barring an upgrade, it seems your best bet would be to
?
Regards,
Neil
From: Nils Jünemann [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Query Two Databases
Date: Thu, 25 Jan 2007 12:01:48 +0100
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Neil Tompkins schrieb:
Not sure if this is possible or not. But I've two identical tables in
two
[EMAIL PROTECTED] (Jerry Jones) wrote in
news:[EMAIL PROTECTED]:
I am trying to do an update, where item numbers 1-9 get four 0's added
to the front, 10-99 get three 0's etc.
mysql HELP LPAD
Name: 'LPAD'
Description:
Syntax:
LPAD(str,len,padstr)
Returns the string str, left-padded with the
Hi Kim,
Kim Christensen wrote:
The error I get while trying executing is Unknown column
'products.product_id' in 'on clause'. Since I am selecting all
columns from that table (products), I can't really see why there's a
fuss about it!
I'm thankful for every tip I can get, and please let me
Hi,
The error I get while trying executing is Unknown column
'products.product_id' in 'on clause'. Since I am selecting all
columns from that table (products), I can't really see why there's a
fuss about it!
# SELECT products.*, manufactors.*,
# IF((
# SELECT i.supplier_id FROM
Not sure if this is possible or not. But I've two identical tables in two
different databases. Is it possible to retrieve data from the different
tables in one query ?
Yes, by using this notation:
select *
from mydatabase.mytable
Martijn Tonies
Database Workbench - development tool for
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Neil Tompkins schrieb:
Not sure if this is possible or not. But I've two identical tables in
two different databases. Is it possible to retrieve data from the
different tables in one query ?
(SELECT * FROM db1.table) UNION (SELECT * FROM
The databases are on the same server, however the login details for each
database are different.
From: Martijn Tonies [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Query Two Databases
Date: Thu, 25 Jan 2007 11:56:37 +0100
Not sure if this is possible or not. But I've two
On Thursday 25 January 2007 11:08, Neil Tompkins wrote:
The databases are on the same server, however the login details for each
database are different.
A query executes with the credentials of the authentication used to set up the
connection. If you want to query two tables simultaneously
The databases are on the same server, however the login details for each
database are different.
Hmm, I guess that the currently connected user needs to have access
to both databases, how else would it get the data?
Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Hi Raman,
Is mysql is able to manage this huge amount of data.
MySQL does manage this amount of data very easily.
Can we put this much of data in single table database OR keeping the
data in multiple tables is the good practice.
You can keep this much amount of data in one single MySQL
Hi,
1) In MySQL, the size of the table limits to the storage engine and the file
system size. [minimum -default -2GB]
2) As of our understanding, keeping in multiple tables is a good practice,
that too with perfect normalization. If multiple tables, table sizes are in
hand, limit of file
At 12:14 AM 1/19/2007, Dan Nelson wrote:
In the last episode (Jan 18), Miles Thompson said:
The query displayed below performs flawlessly, except for these two
records:
7364 M0174000250510 Invoice 2006-12-13
2006-12-13 2006-12-31
7365 M01740
At 03:58 AM 1/19/2007, Felix Geerinckx wrote:
[EMAIL PROTECTED] (Miles Thompson) wrote in
news:[EMAIL PROTECTED]:
This query:
SELECT
member_id,
member_sub_id,
IF( ( monthly_cost = 10 ), ( SUM(( monthly_cost * 2.00 ) + 200 )
), ( SUM(
monthly_cost * 12.00 ) ) ) AS
Miles
Try it yourself with table tbl (id,cost) with rows (1,10),(1,50),(2,100):
SELECT
id,
IF( cost=10, SUM(cost*2 )+ 200, SUM(cost*12)) AS Amount
FROM tbl
GROUP BY id,cost;
+--++
| id | Amount |
+--++
|1 |320 |
|2 | 1200 |
+--++
SELECT
id,
Peter (and Felix),
Thank you, and I learned something today. Now I have a script that needs
adjusting.
The amount certainly is indeterminate.
The wonder is that we were able to run with this for so long.
Regards - Miles
At 03:57 PM 1/21/2007, Peter Brawley wrote:
Miles
Try it yourself
[EMAIL PROTECTED] (Miles Thompson) wrote in
news:[EMAIL PROTECTED]:
This query:
SELECT
member_id,
member_sub_id,
IF( ( monthly_cost = 10 ), ( SUM(( monthly_cost * 2.00 ) + 200 )
), ( SUM(
monthly_cost * 12.00 ) ) ) AS Amount
FROM subinfo
WHERE
In the last episode (Jan 18), Miles Thompson said:
The query displayed below performs flawlessly, except for these two records:
7364 M0174000250510 Invoice 2006-12-13 2006-12-13
2006-12-31
7365 M01740 002506 5 Invoice 2006-12-13
[EMAIL PROTECTED] wrote:
FROM .$tn., bill_info as b
LEFT JOIN shipp_info as sh ON (b.bill_id=sh.bill_id
That would be the usage of multiple from's combined with a left join.
Unfortunately with mysql 5 you can't do this. You're going to have to
do bill_info as a left/right/inner join
[EMAIL PROTECTED] wrote:
FROM .$tn., bill_info as b
LEFT JOIN shipp_info as sh ON (b.bill_id=sh.bill_id
That would be the usage of multiple from's combined with a left join.
Unfortunately with mysql 5 you can't do this. You're going to have to
do bill_info as a left/right/inner join
Table3
Etc etc...
But you cannot do:
SELECT
Field1, field2
FROM
Table1, Table2
LEFT JOIN Table3
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 16, 2007 11:06 AM
To: Chris White
Cc: mysql@lists.mysql.com
Subject: Re
I have not tried, but i think this is what he meant:
FROM
tn t
INNER JOIN bill_info b ON (b.id_b = t.id_t)
LEFT JOIN shipp_info sh ON (b.bill_id=sh.bill_id)
HTH,
On 1/16/07, Chris White [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
FROM .$tn., bill_info as b
LEFT JOIN
:[EMAIL PROTECTED]
Sent: Tuesday, January 16, 2007 11:06 AM
To: Chris White
Cc: mysql@lists.mysql.com
Subject: Re: query taht works on mysql4 but doesn't on mysql5?
[EMAIL PROTECTED] wrote:
FROM .$tn., bill_info as b
LEFT JOIN shipp_info as sh ON (b.bill_id=sh.bill_id
That would
Make sure that all joined fields are of identical types, otherwise the
query executor must cast each and every join value, which may be
affecting the query time...
Jay
Chris Boget wrote:
Here is a query I'm trying to run. It doesn't look like it is overly
complex and, granted, it's joining on
Make sure that all joined fields are of identical types, otherwise the
query executor must cast each and every join value, which may be
affecting the query time...
Can you even define fields having foreign keys to be of a different type?
Anyway, taking a look at my JOIN
INNER JOIN users ON
I only want to view the product per product name
which has the lowest price.
SELECT product_name,MIN(price)
FROM tbl
GROUP BY product_name;
PB
uYe wrote:
Hi,
I have a table with product_name, price field. The product name may be exist
in more than one record. I only want to view the product
Try this on for size:
SELECT DISTINCT id FROM tbl
WHERE id NOT IN (SELECT id FROM tbl WHERE action = 1)
The subselect will only work in 4.1 and later I think.
Dan
On 12/8/06, bruce [EMAIL PROTECTED] wrote:
hi...
i'm looking at what is probably a basic question.
i have a tbl with
-id
bruce wrote:
hi...
i'm looking at what is probably a basic question.
i have a tbl with
-id
-action
-status
-date
ie:
id action statusdate
1 0 1
1 1 2
1 2 3
-
2
Ysgrifennodd bruce:
hi...
i'm looking at what is probably a basic question.
i have a tbl with
-id
-action
-status
-date
ie:
id action statusdate
1 0 1
1 1 2
1 2 3
-
.
i've tried to do a 'limit' and group, but i'm missing some thing...
thanks
-bruce
-Original Message-
From: Peter Bradley [mailto:[EMAIL PROTECTED]
Sent: Friday, December 08, 2006 12:26 PM
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: query question...
Ysgrifennodd bruce
-bruce
-Original Message-
From: Peter Bradley [mailto:[EMAIL PROTECTED]
Sent: Friday, December 08, 2006 12:26 PM
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: query question...
Ysgrifennodd bruce:
hi...
i'm looking at what is probably a basic question.
i have a tbl
Ysgrifennodd bruce:
hi peter.
thanks, the solution you gave me is close...!!
snip
what i really want to get is:
+--+
| universityID |
+--+
|2 |
|3 |
+--+
which would be the unique 'id's.
i've tried to do a 'limit' and group, but
dan...
thanks!!! like a charm.. now for the other 200 queries i'm dealing with!!
-Original Message-
From: Dan Buettner [mailto:[EMAIL PROTECTED]
Sent: Friday, December 08, 2006 1:40 PM
To: [EMAIL PROTECTED]
Cc: Peter Bradley; mysql@lists.mysql.com
Subject: Re: RE: query question
Chris,
Thanks for clearing that up. You are right, I don't want the general
log or the mysql shell history.
I'm not happy that I can't get at the Query Cache. I am sure there are
tools which MySql developers must use to test the cache. I'll have to
look at the source code directories...
Ben Clewett wrote:
Hi Mohsen,
Thanks for the reply.
I'm looking in the home directory, as well as the other directories
used by mysql and I can't see any files which I do not recognise. (I
am UNIX so there are no hidden files.)
I am also a little confuses as the Query Cache is entirely a
Hi Mohsen,
Thanks for the advise. On my AIX system as root, dot files not hidden.
For instance my mysql home directory looks like:
drwxr-xr-x 16 mysqlmysql 4096 04 Dec 20:18 .
drwxr-xr-x 31 root system 4096 09 Nov 15:12 ..
drwxr-xr-x 2 mysqlmysql
Ben Clewett wrote:
Hi Mohsen,
Thanks for the advise. On my AIX system as root, dot files not
hidden. For instance my mysql home directory looks like:
drwxr-xr-x 16 mysqlmysql 4096 04 Dec 20:18 .
drwxr-xr-x 31 root system 4096 09 Nov 15:12 ..
drwxr-xr-x 2 mysql
Hi Mohsen,
I see, the difference between the home of mysql and the mysql home...
As you asked:
mysql:*:204:1::/home/mysql:/usr/bin/ksh
# ls -la /home/mysql
4 -rwxr- 1 mysqlstaff 254 14 Feb 2005 .profile
Regards,
Ben
Mohsen Pahlevanzadeh wrote:
Ben Clewett wrote:
Mohsen Pahlevanzadeh wrote:
Ben Clewett wrote:
Hi Mohsen,
Thanks for the reply.
I'm looking in the home directory, as well as the other directories
used by mysql and I can't see any files which I do not recognise. (I
am UNIX so there are no hidden files.)
I am also a little confuses as
Hi Mohsen,
Thanks for the reply.
I'm looking in the home directory, as well as the other directories used
by mysql and I can't see any files which I do not recognise. (I am UNIX
so there are no hidden files.)
I am also a little confuses as the Query Cache is entirely a memory
structure,
H. I actually think this would be somewhat difficult to write,
Robert. Parsing the queries would be complex enough given the
different ways one can construct SQL. Also it would have to examine
the cardinality of the data in each column to determine if indexing
would be worthwhile vs. a
PROTECTED]
Sent: Friday, November 03, 2006 1:40 PM
To: Robert DiFalco
Cc: mysql@lists.mysql.com
Subject: Re: Query Analysis Tool
H. I actually think this would be somewhat difficult to write,
Robert. Parsing the queries would be complex enough given the different
ways one can construct SQL
Hi Jonathon,
MySQL is using the index for both queries,
as the column key in the explain result says.
Using index means that MySQL can find all info
it needs by looking at the index only, i.e doesn't
need to look into the table.
See:
http://dev.mysql.com/doc/refman/5.0/en/explain.html
for more.
Hi Johan,
Thanks for that, it explains what's going on. I've added `date` to the
`coords` index and that seems to have sped things up considerably. Thanks.
- Jonathon
Johan Höök wrote:
Hi Jonathon,
MySQL is using the index for both queries,
as the column key in the explain result says.
Dan, your suggestion is *exactly* what I needed!
Furthermore, because of the use of the subquery, there is no need to
join to table to itself, so the query may be simplified to:
mysql SELECT distinct loc1.imageId
- FROM locBridgeImageLocLevel5 as loc1
- WHERE loc1.locLevel5Id =
Erick, maybe I'm missing something or you mistyped, but you appear to
be saying this:
you want 2356 and not 13128
but your last SQL query is excluding only 18302. 13128 is not
mentioned in the query.
Try re-running the query with 13128 instead of 18302 ?
Dan
On 10/17/06, Erick Carballo
Dan, thanks for your prompt response. You are correct: I mistyped.
However, if I ran the query as you suggest, I obtain the same results:
mysql SELECT distinct loc1.imageId
- FROM locBridgeImageLocLevel5 as loc1
- INNER JOIN
- locBridgeImageLocLevel5 as loc2 USING (imageId)
I see what's happening, Erick.
It's matching all the rows in loc1 and loc2 with the same image id.
It *is* excluding 13128, but image id 1 is still appearing because of
the rows where they match *besides* 13128. For example, 18302 and
actually also 2356 since you're joining a table on itself.
Thank u so much. It woked now!
- Original Message -
From: Visolve DB Team [EMAIL PROTECTED]
To: Visolve DB Team [EMAIL PROTECTED]; Renish
[EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Tuesday, October 10, 2006 1:42 PM
Subject: Re: Query Help plss
Hi,
Hope this link will you.
http
Renish koshy wrote:
Hi all,
I have installed MySql 4.1 in my system. when I tried to run Mysql , I
always gets this error.
Could not start MySql service on a local computer
Error 1067: the process terminated unexpectedly.
Stop sending this message!
We get the idea!
The more you send it,
Xp
- Original Message -
From: Visolve DB Team [EMAIL PROTECTED]
To: Renish koshy [EMAIL PROTECTED]
Sent: Tuesday, October 10, 2006 11:42 AM
Subject: Re: Query Help plss
Hi,
On which platform?
Thanks
ViSolve DB Team.
- Original Message -
From: Renish koshy [EMAIL PROTECTED
@lists.mysql.com
Sent: Tuesday, October 10, 2006 12:35 PM
Subject: Fw: Query Help plss
- Original Message -
From: Renish
To: mysql@lists.mysql.com ; Visolve DB Team
Sent: Tuesday, October 10, 2006 12:34 PM
Subject: Re: Query Help plss
b) And what happend when you open
:03 AM
Subject: Re: Query Help plss
Hi
The .err file shows that the service is stopped Normally and no error was
found. sure the service is properly shutdown.
Try,
a)
net stop mysql
mysqld-nt remove
mysqld-nt install
net start mysql
b)
Also run 'services.msc' and double click on the mysql
On Mon, 2006-09-25 at 06:09 -0700, Steffan A. Cline wrote:
Basically all 6 should come up in the big query because they are within the
same zip and that any other locations within the same area. They all have
the same latitude and longitude but only 1 shows up.
If they all have the same
Subject: Re: Query missing rows in location of zip by distance
On Mon, 2006-09-25 at 06:09 -0700, Steffan A. Cline wrote:
Basically all 6 should come up in the big query because they are within the
same zip and that any other locations within the same area. They all have
the same latitude
But you can't get a group by from an alias.
That surprises me. I tried putting the calculation of age in a
subquery but that didn't work, either. And I've never quite
figured out how to create a temporary table for intermediate
results. There has _got_ to be a way to do this, even an
2006/9/19, Peter Van Dijck [EMAIL PROTECTED]:
Hi all,
trying to figure out if there is a query I can use for this, or if I
have to write a php script to loop tru each row...
table1:
entryid int(11)
itemid int(11)
table2:
object_id int(11)
The situation is: table2.objectid is populated
Server version: 5.0.24
This query is working OK for me. I'm using FROM_DAYS() to avoid errors
due to leap years.
SELECT extract(YEAR FROM from_days(datediff(curdate(), dateofbirth))) AS
age, SUM(extract(YEAR FROM from_days(datediff(curdate(), birth_date
AS total_age FROM
If your dateOfBirth is a date field,
It is.
you can do this:
select
(substring(curdate(),1,4)-substring(dateofbirth,1,4))-
(substr(curdate(),5)substr(dateofbirth,5))
as age
from myTable;
Thanks. That's a little more accurate (thought that doesn't quite
matter in my case).
But
Nelson:
I have double checked my last post, and the following works:
SELECT
DISTINCT(FLOOR((datediff(curdate(), dateofbirth)/365))) as age,
COUNT(FLOOR((datediff(curdate(), dateofbirth)/365))) AS total_age
from myTable
group by age
Tell us if it worked for you.
Regards,
Alvaro
On
If your dateOfBirth is a date field, you can do this:
select
(substring(curdate(),1,4)-substring(dateofbirth,1,4))-(substr(curdate(),5)substr(dateofbirth,5))
as age
from myTable;
But you can't get a group by from an alias.
Hope help.
[EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL
You could try something like this:
SELECT
DISTINCT(round(datediff(curdate(), dateofbirth)/365)) as age,
COUNT(round(datediff(curdate(), dateofbirth)/365)) AS total_age
from myTable
group by age
Not sure, but could work.
Regards,
Alvaro
João Cândido de Souza Neto escribió:
If your
Philip Hallstrom wrote:
Hi all, a though query problem for me...
I have a table with 2 rows that matter: url and id
If url and id are the same in 2 rows, then that's no good (bad data).
I need to find all the rows that are duplicates. I can't think of how
to approach the sql for this.. any
Philip Hallstrom wrote:
Hi all, a though query problem for me...
I have a table with 2 rows that matter: url and id
If url and id are the same in 2 rows, then that's no good (bad data).
I need to find all the rows that are duplicates. I can't think of how
to approach the sql for this.. any
You should always have a field that is a unique id for the record (i.e. autoincrement). It makes it easier for differentiating and
deleting duplicates if needed. This query only works if you have a unique id field and it will only delete one duplicate record at a
time. So if you have 4 records
Philip Hallstrom wrote:
Philip Hallstrom wrote:
Hi all, a though query problem for me...
I have a table with 2 rows that matter: url and id
If url and id are the same in 2 rows, then that's no good (bad data).
I need to find all the rows that are duplicates. I can't think of how
to approach
Select COUNT(*) as num_entries, url from table WHERE num_entries1 GROUP
BY url
Untested, but the concept should work for you.
Steve Musumeche
CIO, Internet Retail Connection
[EMAIL PROTECTED]
Peter Van Dijck wrote:
Hi all, a though query problem for me...
I have a table with 2 rows that
Hi all, a though query problem for me...
I have a table with 2 rows that matter: url and id
If url and id are the same in 2 rows, then that's no good (bad data).
I need to find all the rows that are duplicates. I can't think of how
to approach the sql for this.. any pointers?
Select
Could you post an example of a query you are expecting to be cached?
On Wed, 2006-08-30 at 11:43 -0500, Mazur Worden, Kathy wrote:
Hi,
I just turned on the query cache by modifying its size and limit and
restarting the server. However queries aren't being stored to it:
]
Sent: Wednesday, August 30, 2006 12:07 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: Re: query cache question
Could you post an example of a query you are expecting to be cached?
On Wed, 2006-08-30 at 11:43 -0500, Mazur Worden, Kathy wrote:
Hi,
I just turned on the query
What else would prevent queries from getting into the cache?
Anything with NOW() in it or any of it's related functions...
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
@lists.mysql.com
Subject: Re: query cache question
Could you post an example of a query you are expecting to be cached?
On Wed, 2006-08-30 at 11:43 -0500, Mazur Worden, Kathy wrote:
Hi,
I just turned on the query cache by modifying its size and limit and
restarting the server. However
The output of that query is:
@@global.query_cache_size
10485760
Kathy Mazur Worden
Prairie Area Library System
-Original Message-
From: Jay Pipes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 12:42 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: RE: query
-Original Message-
From: Jay Pipes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 12:42 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: RE: query cache question
Those queries look just fine to me.
Could you output the result of the following:
SELECT
: Jay Pipes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 2:12 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: RE: query cache question
Please show the output of:
SELECT @@global.query_cache_type;
and then:
SHOW GLOBAL STATUS LIKE 'Qc%';
Thanks!
On Wed, 2006-08-30
, 2006 2:12 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: RE: query cache question
Please show the output of:
SELECT @@global.query_cache_type;
and then:
SHOW GLOBAL STATUS LIKE 'Qc%';
Thanks!
On Wed, 2006-08-30 at 13:43 -0500, Mazur Worden, Kathy wrote
Actually no, I'm not using any prepared statements. But thanks for the
pointer on that.
-Original Message-
From: Jay Pipes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 2:24 PM
To: Mazur Worden, Kathy
Cc: mysql@lists.mysql.com
Subject: RE: query cache question
Ah, I think
On 8/23/06, Ratheesh K J [EMAIL PROTECTED] wrote:
Hello all,
I wanted to know why a select query takes ,say, 18 sec to execute the first
time I execute it and then for every successive execution it takes, say, 10 sec.
I have disabled Query Caching on the server. If its not Query Caching then
When a query goes from 18 to 10 seconds, or similar times, it is likely
because of caching at the MySQL or OS/disk level, not query caching. The
first time, the info had to be found on the disk and read, which is
relatively slow. After that it's in memory and can be accessed more quickly
in the
More than likely, the OS file system is caching the files that make up the
tables.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
-Original Message-
From: Ratheesh K J [mailto:[EMAIL PROTECTED]
Sent:
Peter Van Dijck wrote:
I have a table with userid and text. Users write text. I want to find
the top 5 users who have the most rows in this table.
I can't seem to figure out the query.. is there a query possible to do
this?
Thanks!
Peter
SELECT Count(*) as Count, UserID
FROM table
GROUP
brilliant, that works! Thanks!
On 8/20/06, Chris W [EMAIL PROTECTED] wrote:
Peter Van Dijck wrote:
I have a table with userid and text. Users write text. I want to find
the top 5 users who have the most rows in this table.
I can't seem to figure out the query.. is there a query possible
VenuGopal Papasani wrote:
Dear all,
I have a table with the following structure.
ield Type CollationNullKey Default
Extra Privileges Comment
--- -- -- ---
select userid,count(text) from blah group by userid;
--On August 20, 2006 7:22:59 PM +0100 Peter Van Dijck
[EMAIL PROTECTED] wrote:
I have a table with userid and text. Users write text. I want to find
the top 5 users who have the most rows in this table.
I can't seem to figure out the
VenuGopal Papasani wrote:
Once again i send the table data:
Code Period Value
c12004 22
c12005 10
c22005 15
c32005 20
c42005 15
c52005 5
c62005 30
c7
The story so far, with comments:
Michael DePhillips wrote:
Hi,
Does anyone have a clever way of returning; a requested value with one
value less than that value, and one value greater than that value with
one query.
For example T1 contains
ID
1234
1235
1236
1238
select ID from T1
if it is static then it works fine.but we have lots of codes in a table
which should be done similar operation.instead varifying staticly with c1,c2
can we make dynamic.
On 8/14/06, Peter Lauri [EMAIL PROTECTED] wrote:
SELECT SUM(IF(code='c1', code, IF(code='c2', code, 0))) -
SUM(IF(code='c4',
Not until we know the logic behind the code and how the calculations
should be done.
-Original Message-
From: VenuGopal Papasani [mailto:[EMAIL PROTECTED]
Sent: Monday, August 14, 2006 1:03 PM
To: Peter Lauri; mysql@lists.mysql.com
Subject: Re: query needed
if it is static then it works
Michael,
I would think this is what you want.
Select ID from T1 where ID BETWEEN (id in question - 1) and (id in
question + 1)
If you want distinct values, place the distinct keyword in front of ID (i.e.
Select DISTINCT ID...
This should do it for you.
-Dan
Hi,
Does anyone have a clever
Michael DePhillips wrote:
Hi,
Does anyone have a clever way of returning; a requested value with
one value less than that value, and one value greater than that value
with one query.
For example T1 contains
ID
1234
1235
1236
1238
Assuming the id's are consecutive.
You want
Hi Dan,
Thanks for the prompt reply,
As I described it yes, you are correct, however, the id may not always
be one(1) value away. So the number one needs, somehow, to be replaced
with a way to get the next largest value and the previous less than
value.
Sorry for the lack of precision in
301 - 400 of 1474 matches
Mail list logo