From: Brandon Phelps bphe...@gls.com
I am curious if there is any way I can better optimize the below query, as
currently it takes this query around 10 seconds to run but I am sure this
will get slower and slower as the database grows.
You need an index on `close_dt`.
SELECT
What's your vb code for outputting the results look like?
On Jul 24, 2011 8:22 AM, Velen Vydelingum ve...@biz-mu.com wrote:
Hi,
I have the following query which is fine when I run it from the mysql shell
screen:
select supplier_code,0,0,0,0,0-sum(amountpaid),0 from custpayments where
-
From: Johnny Withers joh...@pixelated.net
To: Velen Vydelingum ve...@biz-mu.com
Cc: mysql@lists.mysql.com
Sent: Sunday, July 24, 2011 17:41
Subject: Re: Query bug
What's your vb code for outputting the results look like?
On Jul 24, 2011 8:22 AM, Velen Vydelingum ve...@biz-mu.com wrote:
Hi
On Wed, 13 Jul 2011 12:26:02 -0600
Elim Qiu elim@gmail.com wrote:
I have a prime table
what the query will be if i like to find all rows where pv+2's are
also in colum 'pv', where oid 100?
In other words, how to get the list of yonger brother of the twin
primes within certain
On Jul 13, 2011 2:26 PM, Elim Qiu elim@gmail.com wrote:
I have a prime table
+-+--+-+
| oid | pv | descipt |
+-+--+-+
| 1 |2 | NULL|
| 2 |3 | NULL|
| 3 |5 | NULL|
| 4 |7 | NULL|
| 5 | 11 | NULL|
|
At 01:26 PM 7/13/2011, you wrote:
I have a prime table
+-+--+-+
| oid | pv | descipt |
+-+--+-+
| 1 |2 | NULL|
| 2 |3 | NULL|
| 3 |5 | NULL|
| 4 |7 | NULL|
| 5 | 11 | NULL|
| .|
How about:
select t1.pv, t2.pv from prime t1, prime t2 where t2.pv=t1.pv+2 and
t1.oid100 order by t2.pv
Mike
Very nice and simple. Thanks Mike!
Also Thanks Singer X.J. Wang and shawn wilson.
best regards,
Elim
--
MySQL General Mailing List
For list archives:
Try this out:-)
Below are the steps to generate a deadlock so that the behaviour of a
deadlock can be illustrated:
-- 1) Create Objects for Deadlock Example
USE TEMPDB
CREATE TABLE dbo.foo (col1 INT)
INSERT dbo.foo SELECT 1
CREATE TABLE dbo.bar (col1 INT)
INSERT dbo.bar SELECT 1
-- 2) Run in
Thanks Suresh but I find it very difficult to implement it :-
Suresh Kuna wrote:
Try this out:-)
Below are the steps to generate a deadlock so that the behaviour of a
deadlock can be illustrated:
-- 1) Create Objects for Deadlock Example
USE TEMPDB
Is I have to create temdb database as
@lists.mysql.com
Subject: Re: Query on wait_timeout
Thanks Suresh but I find it very difficult to implement it :-
Suresh Kuna wrote:
Try this out:-)
Below are the steps to generate a deadlock so that the behaviour of a
deadlock can be illustrated:
-- 1) Create Objects for Deadlock Example
Just a little side note,
The table engine needs to be InnoDB or the transaction will not have effect,
The behavior may differs also according to the isolation level,
That will apply a lock on all records because no where is specified, which
its not very common.
Regards,
Claudio
On Jun 16, 2011
Good question Yogesh, I can say the best solution is
Create a deadlock and test it, you will come to know more about it.
On Wed, Jun 15, 2011 at 3:38 PM, Yogesh Kore yogeshk...@gmail.com wrote:
Hi,
Small doubt for wait_timeout.
If my wait_timeout is set for 180 seconds and if any deadlock
How we can create a deadlock manually to test this problem.
Thanks
Suresh Kuna wrote:
Good question Yogesh, I can say the best solution is
Create a deadlock and test it, you will come to know more about it.
On Wed, Jun 15, 2011 at 3:38 PM, Yogesh Kore yogeshk...@gmail.com wrote:
Hi,
Hi Neil,
select
login_id,
ip_address
from
basic_table
group by
login_id,ip_address
having
count(login_id,ip_address)1
this should work
in case you want to see also the list of emails add:
group_concat(email_address,',') as list_of_used_emails
to the select fields.
Claudio
-Original Message-
From: Tompkins Neil [mailto:neil.tompk...@googlemail.com]
Sent: Wednesday, March 02, 2011 6:00 AM
To: [MySQL]
Subject: Query help
Hi
I've the following basic table
login_id
email_address
ip_address
I want to extract all records from this table in which a user has
Thanks for the response. This is what I was after. Although, I am looking
to find out the email addresses used to login from the same IP ?
On Wed, Mar 2, 2011 at 2:49 PM, Jerry Schwartz je...@gii.co.jp wrote:
-Original Message-
From: Tompkins Neil
...@googlemail.com]
Sent: Wednesday, March 02, 2011 10:12 AM
To: Jerry Schwartz
Cc: [MySQL]
Subject: Re: Query help
Thanks for the response. This is what I was after. Although, I am looking
to find out the email addresses used to login from the same IP ?
On Wed, Mar 2, 2011 at 2:49 PM, Jerry
Hi Johan,
On Sun, Dec 19, 2010 at 7:11 PM, Johan De Meersman vegiv...@tuxera.bewrote:
You can't query the index directly, but if you select only fields that are
in the index, no table lookups will be performed - this is called a covering
index.
Great.. Thanks for the confirmation.
Regards,
On Sun, Dec 19, 2010 at 3:19 AM, Feris Thia
milis.datab...@phi-integration.com wrote:
Hi Everyone,
Is there a way to query values stored in our index instead of using group
by selection which will produce same results ?
You can't query the index directly, but if you select only fields that
On 10/27/2010 6:55 AM, Nuno Mendes wrote:
I have 3 tables: (1) Companies, (2) locations and (3) employees:
CREATE TABLE `companies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(75) NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `locations ` (
`id`
Thats because float columns store approximate data values, you may need
to use an error range in comparison, or at your own discretion use the
decimal data type.
You can get more info in:
http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html
In the last episode (Oct 25), Sairam Krishnamurthy said:
I have simple query like 'select * from table1 where
column1=-107.689878'. This returns an empty set. But there is data
corresponding to this value of column.
When I looked more into it, it seems like a precision issue. The
That is exactly the problem. It is float. Thanks for your input.
Thanks,
Sairam Krishnamurthy
+1 612 859 8161
On 10/25/2010 01:00 PM, Dan Nelson wrote:
In the last episode (Oct 25), Sairam Krishnamurthy said:
I have simple query like 'select * from table1 where
column1=-107.689878'.
Sairam,
sorry to be so blunt, and please don't feel offended:
Sairam Krishnamurthy wrote:
[[...]]
Can somebody help me to find out the problem? I can very well truncate
the trailing zeros when querying, but I am interested in finding why an
additional trailing zero returns an empty set.
It's about syntax and clarity, both for the reader and to the query
optimizer. The JOIN conditions belong in the ON sub-statement
precisely because they are the predicate for the join and serve to
grow the data set .. the WHERE query is supposed to specify limiting
conditions on that superset.
did u try to use LIMIT after ORDER BY
On Thu, Sep 9, 2010 at 1:27 PM, Tompkins Neil
neil.tompk...@googlemail.comwrote:
Any help would be really appreciated ?
-- Forwarded message --
From: Tompkins Neil neil.tompk...@googlemail.com
Date: Wed, Sep 8, 2010 at 5:30 PM
Yes, but it doesn't work. Basically I want the SUM(players_master.rating)
only to SUM the top 11 players from each team. Any suggestions ?
Cheers
Neil
On Thu, Sep 9, 2010 at 9:17 AM, Ananda Kumar anan...@gmail.com wrote:
did u try to use LIMIT after ORDER BY
On Thu, Sep 9, 2010 at 1:27
try using the RANK function...
something like select * from table order by RANK desc limit 11.this will
get u the top 11 rows.
regards
anandkl
On Thu, Sep 9, 2010 at 1:55 PM, Tompkins Neil
neil.tompk...@googlemail.comwrote:
Yes, but it doesn't work. Basically I want the
MySQL doesn't have the windowing functions that some other databases
provide, but you can probably achieve the same effect with a couple
user-defined variables:
select
teams_id as my_teams_id
,sum(rating) as total_team_rating
from
(select
players.teams_id
,players.players_id
Tompkins,
Which field stores the result of matches.
regards
anandkl
On Mon, Sep 6, 2010 at 4:45 PM, Tompkins Neil
neil.tompk...@googlemail.comwrote:
Hi,
I've the following fields within a table :
fixtures_results_id
home_teams_id
away_teams_id
home_goals
away_goals
home_users_id
These two fields
home_goals and away_goals
Cheers
Neil
On Mon, Sep 6, 2010 at 12:58 PM, Ananda Kumar anan...@gmail.com wrote:
Tompkins,
Which field stores the result of matches.
regards
anandkl
On Mon, Sep 6, 2010 at 4:45 PM, Tompkins Neil
neil.tompk...@googlemail.com wrote:
Hi,
Also, can u please lets u know the value's in this table.
Just one row, an example would do.
regards
anandkl
On Mon, Sep 6, 2010 at 5:35 PM, Tompkins Neil
neil.tompk...@googlemail.comwrote:
These two fields
home_goals and away_goals
Cheers
Neil
On Mon, Sep 6, 2010 at 12:58 PM,
For sure here is some sample data
home_teams_id,away_teams_id,home_goals,away_goals,home_users_id,away_users_id
100,200,2,1,5,6
200,100,1,1,6,5
Here is two rows of data for the same fixture both home and away
Let me know if you need any more info.
Cheers
Neil
On Mon, Sep 6, 2010 at 1:08 PM,
Something like this might work:
insert into domains
select a.accountid, reverse(a.domainid), a.mailname
from domains a
left outer join domains b on b.domainid = reverse(a.domainid) and
b.accountid = a.accountid and b.mailname = a.mailname
where b.domainid is null;
-Travis
responsabilité pour le contenu fourni.
Date: Sat, 31 Jul 2010 10:31:43 +0700
From: cuong.m...@vienthongso.com
To: ave...@yahoo-inc.com
CC: mustafa...@gmail.com; mysql@lists.mysql.com
Subject: Re: query results group/summed by interval
Hi Aveek,
I think Ghulam just
Date: Sun, 1 Aug 2010 13:16:36 +0100
From: nuno.tava...@dri.pt
To: mgai...@hotmail.com
CC: cuong.m...@vienthongso.com; ave...@yahoo-inc.com; mustafa...@gmail.com;
mysql@lists.mysql.com
Subject: RE: query results group/summed by interval
Hi all
.
Date: Sat, 31 Jul 2010 10:31:43 +0700
From: cuong.m...@vienthongso.com
To: ave...@yahoo-inc.com
CC: mustafa...@gmail.com; mysql@lists.mysql.com
Subject: Re: query results group/summed by interval
Hi Aveek,
I think Ghulam just want to count calls for each intervals
so the query should looks
.
Date: Sat, 31 Jul 2010 10:31:43 +0700
From: cuong.m...@vienthongso.com
To: ave...@yahoo-inc.com
CC: mustafa...@gmail.com; mysql@lists.mysql.com
Subject: Re: query results group/summed by interval
Hi Aveek,
I think Ghulam just want to count calls for each intervals
so the query should
mustafa...@gmail.com, mysql@lists.mysql.com
Sent: Tuesday, July 27, 2010 5:54:13 PM
Subject: RE: query results group/summed by interval
try this ...
select 5 * floor(seconds/5) as start, 5 * floor(seconds/5) + 5 as end,
sum(calls) from calls group by 5 * floor(seconds/5);
This should give you
try this ...
select 5 * floor(seconds/5) as start, 5 * floor(seconds/5) + 5 as end,
sum(calls) from calls group by 5 * floor(seconds/5);
This should give you an output of the type
+---+--++
| start | end | sum(calls) |
+---+--++
| 0 |5 |
At 09:29 AM 7/13/2010, æå¾ wrote:
Hello,
There are more than 2m records in the table -- fxrate.
I create patitions, indexes, but it still takes me about 7 minutes to
execute the following query
SELECT COUNT(*)
FROM fxrate
WHERE MONTH(quoteDate) = 6
AND quoteHourMinSec BETWEEN 06:00:00 AND
You didn't include an EXPLAIN of your query (please use \G so that it is easy
to read), but my guess is that MySQL decided to use a serial search rather
than use an index. It is retrieved 1/4 of your records, and that's after
applying the MONTH() test. The BETWEEN clause is the only place it
On Tue, Jul 13, 2010 at 8:22 AM, mos mo...@fastmail.fm wrote:
At 09:29 AM 7/13/2010, æ Žå¾ wrote:
Hello,
There are more than 2m records in the table -- fxrate.
I create patitions, indexes, but it still takes me about 7 minutes to
execute the following query
SELECT COUNT(*)
FROM fxrate
At 10:36 AM 7/13/2010, Rob Wultsch wrote:
On Tue, Jul 13, 2010 at 8:22 AM, mos mo...@fastmail.fm wrote:
At 09:29 AM 7/13/2010, æ å¾  wrote:
Hello,
There are more than 2m records in the table -- fxrate.
I create patitions, indexes, but it still takes me about 7 minutes to
execute the
[snip]
For the life of me I cannot remember how to make a query like this and
what
it is called.
I know it is fairly basic though.
Table 1
Product_id Product_Name
Table 2
Category_id, Category_name
Table 3
Product_id, Category_id
Each product can have one or more categories.
So I want a
Table 1
Product_id | Product_Name
1| Product A
2| Product B
3| Product C
Table 2
Category_id | Category_Name
1 | Admin
2 | Marketing
3 | Support
4 | IT
Table 3
I believe you're describing a crosstab query. This should help you put it
together:
http://rpbouman.blogspot.com/2005/10/creating-crosstabs-in-mysql.html
---Michael
On Friday, July 09, 2010 07:37:41 pm Phillip Baker wrote:
Hello All,
For the life of me I cannot remember how to make a
Hi!
Jay Blanchard wrote:
[snip]
I have a table similar to this:
-
|transactions |
|ID |DATE |EMPLOYEE|
|234 |2010-01-05| 345|
|328 |2010-04-05| 344|
|239 |2010-01-10| 344|
Is there a way to query such a table to give the
Thank you very much for all the insightful replies. I think I can get it to
work with a join.
Joerg Bruehe joerg.bru...@sun.com wrote:
Hi!
Jay Blanchard wrote:
[snip]
I have a table similar to this:
-
|transactions |
|ID |DATE
Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
From: rich...@rushlogistics.com
To: joerg.bru...@sun.com; mysql@lists.mysql.com
Subject: Re: query help
CC: jblanch
Hi Richard,
This is a LEFT JOIN, but with only one table you may be wondering what to join.
Typically you'll have to create a new table that contains all the dates in the
range you want to check. Then you left join your transaction table, and all
the rows from your dates table that don't
[snip]
I have a table similar to this:
-
|transactions |
|ID |DATE |EMPLOYEE|
|234 |2010-01-05| 345|
|328 |2010-04-05| 344|
|239 |2010-01-10| 344|
Is there a way to query such a table to give the days of the year that
employee 344 did
Hmm. You seem to have overlap, too. I suspect this would be easiest to do in
code - the data you're looking for doesn't exist in the data you have, only
the opposite of that data does.
You could try populating a table with a full day, using the resolution you
need (1 minute resolution means 1440
Not tested, but I think it can help you or at least give you an ideia on how
to do it.
select
EndDateTime + INTERVAL 1 SECOND as startLazy,
(select StartDateTime - INTERVAL 1 SECOND from table t2 where
t2.StartDateTime t1.EndDateTime limit 1) as endLazy
from
table t1
where
(select
SELECT ID, check_no, amount FROM payables UNION SELECT ID, check_no, amount
FROM paychecks;
Regards,
Gavin Towey
-Original Message-
From: Richard Reina [mailto:rich...@rushlogistics.com]
Sent: Tuesday, February 09, 2010 9:23 AM
To: mysql@lists.mysql.com
Subject: query help
I am trying
In the last episode (Jan 17), bharani kumar said:
SELECT updateDate,cHospital,cHospital1,cHospital2 FROM med_patient WHERE
cCurstatus!='completed' AND cMmrcashworker = '2' AND
(cHospital = '1234' OR cHospital1 = '1234' OR cHospital2 ='1234') AND
updateDate between '2010-01-01' and '2010-01-28'
thanks for reply, problem fixed,
On Mon, Jan 18, 2010 at 6:06 AM, Dan Nelson dnel...@allantgroup.com wrote:
In the last episode (Jan 17), bharani kumar said:
SELECT updateDate,cHospital,cHospital1,cHospital2 FROM med_patient WHERE
cCurstatus!='completed' AND cMmrcashworker = '2' AND
Depending on whether you just need to count or the transaction numbers, one of
the following three should get you where you want/need to be:
To identify the count for comp_id = 675:
select count(distinct trans_no) from trans where comp_id = 675 and result = 'o';
To identify the transactions:
On December 13, 2009 01:36:41 pm Richard Reina wrote:
I was wondering if someone could lend a hand with the following query. I
have table.
SEARCHES
|ID |trans_no|comp_id|result
13 | 455| 675| o
15 | 302| 675| o
16 | 455| 675| o
12 | 225| 629|
SELECT count(distinct trans_no) from SEARCHES WHERE comp_id=675 and
result='o';
- Original Message -
From: Richard Reina rich...@rushlogistics.com
To: mysql@lists.mysql.com
Cc: rich...@rushlogistics.com
Sent: Sunday, December 13, 2009 11:36 AM
Subject: Query help
I was wondering if
I'm sorry, you are way off here in what this actually does.
mysql_affected_rows is only going to tell you how many rows were
affected by the execution of the last statement made on your current
connection. It is not an interface to a magic genie maintaining watch
over the state of your entire
Gaurav,
How can I detect from my code whether a table has been updated in the
Database manually
Have a look at Transaction Time Validity in
http://www.osdbzine.net/issue6.pdf and http://www.osdbzine.net/issue7.pdf.
PB
-
Michael Dykman wrote:
I'm sorry, you are way off here in what
On September 26, 2009 05:10:23 am bharani kumar wrote:
courier_id consignor_name consignor_address consignor_destination
consignor_phone
consignee_name consignee_address consignee_destination consignee_phone
s_date s_date_mm s_date_ss r_date r_date_mm r_date_ss
consignment_description
Hi Ciaran,
So I think there's a couple things going on:
1. The explain plan for your slow query looks wrong, such as mysql is
confused. It's possible your index statistics are incorrect. Try ANALYZE
TABLE on listings and addresses.
I think a sure way to fix it is to add STRAIGHT_JOIN to
Hi Gavin,Thanks very much, I'll implement as many of your suggestions as
possible. The varchar(255)'s are inexcusable and I feel suitably ashamed :)
The queries were generated by ActiveRecord (an ORM library for Ruby),
although even if I had written them myself they would probably not be much
You can do this using a variable. Set the variable starting value with
a query:
set @runningTotal := 0
Then add the calculation to your total:
SELECT a. trans_id ,a.tran_date,b.cat_type,a.payee,a.amnt,
@runningTotal := @runningTotal+a.amnt AS rollingTotal from
transactions a join categories b on
Thank you Brent, much appreciated!
On Thu, 2009-09-03 at 14:12 -0400, Brent Baisley wrote:
You can do this using a variable. Set the variable starting value with
a query:
set @runningTotal := 0
Then add the calculation to your total:
SELECT a. trans_id
Bill,
if you use an order by clause in your query, the limit will pick the first
100K rows in that order. That way you can ensure that all rows will be
processed in (wait for it...) order :)
Cheers,
Walter
On Tue, Aug 18, 2009 at 18:44, Bill Arbuckle b...@arbucklellc.com wrote:
I am in need
...@gmail.com] On Behalf Of Walter
Heck - OlinData.com
Sent: Tuesday, August 18, 2009 9:51 AM
To: b...@arbucklellc.com
Cc: mysql@lists.mysql.com
Subject: Re: Query Question
Bill,
if you use an order by clause in your query, the limit will pick the first
100K rows in that order. That way you can
To further emphasize this point: A table has no order by itself,
That's not entirely true ;-) Records are stored in some kind of physical
order, some DBMSses implement clustered keys, meaning that the
records are stored ascending order on disk.
However...
and you should make no
It may be true that some DBMSs physically store rows in whatever order you
speicfy; however, this is a MySQL list, and MySQL does not do this (InnoDB
anyway).
For example, take a table with 10,000,000 rows and run a simple select on
it:
Database changed
mysql SELECT id FROM trans_item LIMIT 1\G
It may be true that some DBMSs physically store rows in whatever order
you
speicfy;
That's not what I said.
however, this is a MySQL list, and MySQL does not do this (InnoDB
anyway).
For example, take a table with 10,000,000 rows and run a simple select on
it:
Database changed
mysql
It sounds to me like you want to join the two tables?
http://dev.mysql.com/doc/refman/5.1/en/join.html
On Mon, Jun 15, 2009 at 03:56, brucebedoug...@earthlink.net wrote:
hi.
i've got a situation, where i'm trying to figure out how to select an item
from tblA that may/maynot be in tblB.
if
Hi Bruce,
bruce wrote:
hi.
i've got a situation, where i'm trying to figure out how to select an item
from tblA that may/maynot be in tblB.
if the item is only in tblA, i can easilty get a list of the items
select * from tblA
if the item is in tblA but not linked to tblB, i can get the
Baron Schwartz wrote:
Hi!
On Wed, Mar 11, 2009 at 8:20 PM, David M. Karr
davidmichaelk...@gmail.com wrote:
Using 5.0.67-0ubuntu6 on Ubuntu 8.10.
I'm going through the High Performance MySQL book. I was reading section
4.4.1.8, titled MIN() and MAX(). The point of this is that MySQL
But EXPLAIN is only a prediction. If you look at the changes in the
Handler status variables, you'll see the second one reads fewer rows.
Ok, I think I get it. I first changed both of my queries to add
sql_no_cache because without that, the Handler_read_rnd_next variable was
zero in both
Hi!
On Wed, Mar 11, 2009 at 8:20 PM, David M. Karr
davidmichaelk...@gmail.com wrote:
Using 5.0.67-0ubuntu6 on Ubuntu 8.10.
I'm going through the High Performance MySQL book. I was reading section
4.4.1.8, titled MIN() and MAX(). The point of this is that MySQL doesn't
optimize MIN()/MAX()
Hi,
On Fri, Feb 13, 2009 at 4:52 PM, PJ af.gour...@videotron.ca wrote:
I am trying to create a php-mysql page to POST new records to several
tables from one php page and I have to retrieve records from several
(like 4 to 8) tables in one query.
Being quite new to php mysql, I am wondering
in question the information is
returned. This produces too many results as some of those users have since
migrated to a different access point.
-Original Message-
From: Andrew Wallo [mailto:theme...@microneil.com]
Sent: Tuesday, February 10, 2009 12:05 PM
To: Ben Wiechman
Subject: Re: Query Help
Alright to reply to myself I can return the information but have been unable
to return the last row... instead it always returns the first row. Tried
max, tried min, tried converting the datetime to a timestamp with the same
results...
mysql SELECT da_userinfo.UserName, da_userinfo.Name,
Ben Wiechman b...@meltel.com wrote on 02/10/2009 01:30:14 PM:
Thanks for the input! That is close to what I need, however not exactly.
It
will give me the last time a user logged into the host in question but I
want to prune users who have since logged into a different host.
Basically
find
: mysql@lists.mysql.com
Subject: RE: Query Help
Ben Wiechman b...@meltel.com wrote on 02/10/2009 01:30:14 PM:
Thanks for the input! That is close to what I need, however not exactly.
It
will give me the last time a user logged into the host in question but I
want to prune users who have since
The index hint is not in productoin code.. I was trying ot force it to use
the index even when using the OR clause.. ment to take that out before I
sent the email.
The table structure is:
CREATE TABLE `customer` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ssn` varchar(32) DEFAULT NULL,
Try a union instead of an or condition.
http://dev.mysql.com/doc/refman/5.0/en/union.html
Johnny Withers wrote:
I have the following tables:
Customer: id,ssn
Customer_Id: id,customer_id,id_num
The customer table holds customers along with their SSN and the customer_id
table holds
Do you have an index on id_num? What sort of explain output do you
get when you don't use a query hint? Your USE INDEX hint may be
causing MySQL to ignore a better strategy.
If you have separate indexes on ssn and id_num, MySQL may be able to
efficiently use an index merge optimization . See
If you have separate indexes on ssn and id_num, MySQL may be able to
efficiently use an index merge optimization . See
http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html.
This is only in 5.0+ - on older versions of MySQL you may find a union
more efficient.
And in newer
On Tue, Jan 13, 2009 at 7:07 PM, Baron Schwartz ba...@xaprb.com wrote:
If you have separate indexes on ssn and id_num, MySQL may be able to
efficiently use an index merge optimization . See
http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html.
This is only in 5.0+ - on older
Hi, I have tried to use this query: SELECT count(smsc_id) as total,
insertdate FROM momtbak WHERE insertdate BETWEEN
DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE() group by
week(date_format(insertdate,'%Y-%m-%d'),3) to group records in the
last 4 weeks by week. But the result
Hi,
I finally found the solution
SELECT count( smsc_id ) AS total, week( insertdate ) AS tanggal
FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB( CURRENT_DATE( ) , INTERVAL 4 WEEK )
AND CURRENT_DATE( )
GROUP BY week( insertdate )
Willy
--
MySQL General Mailing List
For list archives:
On Thu, 2008-12-04 at 08:27 +0700, sangprabv wrote:
Hi,
I get stuck to build a query to select records between curdate() and the
last 4 weeks and groupped by week. I tested with:
SELECT *
FROM momtbak
WHERE insertdate
BETWEEN curdate( )
AND curdate( ) - INTERVAL 4 week
It doesn't
: sangprabv [EMAIL PROTECTED]
Subject: Re: Query to Select records in the last 4 weeks
Date: Wed, 03 Dec 2008 17:52:32 -0800
SELECT * FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE();
--
MySQL General Mailing List
For list archives: http
On Wed, Sep 17, 2008 at 11:37 AM, Uwe Kiewel [EMAIL PROTECTED] wrote:
Hi,
I have two questions regarding the query cache:
1. What is the difference between query_cache_limit and query_cache_size?
query_cache_limit is the maximum size of a single resultset in the
cache. If your query results
Bard Aase schrieb:
On Wed, Sep 17, 2008 at 11:37 AM, Uwe Kiewel [EMAIL PROTECTED] wrote:
Hi,
I have two questions regarding the query cache:
1. What is the difference between query_cache_limit and query_cache_size?
query_cache_limit is the maximum size of a single resultset in the
cache.
On Wed, Sep 17, 2008 at 11:54 AM, Uwe Kiewel [EMAIL PROTECTED] wrote:
Bard Aase schrieb:
On Wed, Sep 17, 2008 at 11:37 AM, Uwe Kiewel [EMAIL PROTECTED] wrote:
Hi,
I have two questions regarding the query cache:
1. What is the difference between query_cache_limit and query_cache_size?
query_cache_limit is the maximum size of a single resultset in the
cache. If your query results in a bigger resultset it will never get
into the cache even if its room for it in the cache itself.
Even if there is room why will it not fit into the cache.
On 9/17/08, Bard Aase [EMAIL
On Wed, Sep 17, 2008 at 12:42 PM, Ananda Kumar [EMAIL PROTECTED] wrote:
query_cache_limit is the maximum size of a single resultset in the
cache. If your query results in a bigger resultset it will never get
into the cache even if its room for it in the cache itself.
Even if there is room
okie..got u
On 9/17/08, Bard Aase [EMAIL PROTECTED] wrote:
On Wed, Sep 17, 2008 at 12:42 PM, Ananda Kumar [EMAIL PROTECTED] wrote:
query_cache_limit is the maximum size of a single resultset in the
cache. If your query results in a bigger resultset it will never get
into the cache even if
http://rpbouman.blogspot.com/2008/07/inspect-query-cahce-using-mysql.html
- parvesh
On Wed, Sep 17, 2008 at 1:15 AM, Edson Noboru Yamada [EMAIL PROTECTED] wrote:
Hey, Guys
Is there a way to know what queries are in the query cache?
thanks
--
MySQL General Mailing List
For list archives:
First, you might want to move the WHERE...t3.int_a = some integer
condition into the join condition for t3.
Your not using anything from t4, so I'm not sure why you have that
table in your query.
You can suggest or force mysql to use an index if it's using the wrong
one:
Peter,
Yes, I know there are two rows in the course_subject table with a
catalog_number of 520. One has a subject of 'ME' and the other has a
subject of 'MSE'.
What I want is ONLY the 'ME' row (if a row exists with a subject of
'ME').If an 'ME' subject row does not exist, then I want
101 - 200 of 1474 matches
Mail list logo