RE: !! Help with query: Where Date = MAX(Date)

2005-02-04 Thread Graham Cossey
> > As I'm using 4.0.20 I can't use subqueries so how can I create > a query that > > does this? > > > > SELECT year, month > > FROM `dc_months` > > WHERE start_date = (SELECT MAX(start_date) > > from dc_months > > where start_date <= '20050204') > >

!! Help with query: Where Date = MAX(Date)

2005-02-04 Thread Graham Cossey
Could someone please offer a little help. I have a table like: Year, Month, Start_date 20041020041102 20041120041203 20041220050104 20050120050204 20050220050303 I need to get the latest Year,Month for a given date, so for example today (20050204) I should

RE: Help with a query using multiple LEFT JOINS

2005-02-01 Thread Graham Cossey
Thanks Tom Doing as you suggested as well as applying the "st.group = 'B'" in the tbl4 ON achieved what I wanted. Graham > -Original Message- > From: Tom Crimmins [mailto:[EMAIL PROTECTED] > Sent: 01 February 2005 00:03 > To: Graham Cossey > Cc: mysql@

Help with a query using multiple LEFT JOINS

2005-01-31 Thread Graham Cossey
I'm hoping someone can help with a little problem I'm having with a query. In the query below I wish to return as least one row per tbl1, however I am only getting rows where there is at least an entry for tbl2 : SELECT ... FROM tbl1 as d LEFT JOIN tbl2 as r ON d.dcode=r.dcode LEFT JOIN tbl3 as

RE: sqlyog

2005-01-20 Thread Graham Cossey
> You're not serious are you? You don't really mean that you want a > restore to > be automatic do you? > > > If you really do mean that you want to completely automate the > restore, what > event is going to trigger the restore? > > Rhino I believe what the OP is after is restoring a database

RE: restoring database

2005-01-18 Thread Graham Cossey
> > > i have written a bat file in which the data databackup has been taken in > sql > > it runs automatically every 1 hour and sends a automatically through email > > now at the other end i have to manually restore the database can any one > give me the codes to restore the database automatically

RE: backup of database

2005-01-18 Thread Graham Cossey
> -Original Message- > From: N. Kavithashree [mailto:[EMAIL PROTECTED] > Sent: 18 January 2005 05:35 > To: mysql@lists.mysql.com > Subject: backup of database > > > > hello, > > > how to take a backup of database? > i have a database with name1 now i want to move all the tables into

RE: mysqlcc

2004-12-12 Thread Graham Cossey
Hi Robin Have you checked you have INSERT authorities to the database as the user you connected as? I have mysqlcc 0.9.2-beta (on Win2k) connecting to a mySQL 4.0.20 (Linux) database and it's been working fine for months. Graham > -Original Message- > From: Robin Lynn Frank [mailto:[EMA

RE: Select member when it meets two requirements

2004-11-30 Thread Graham Cossey
Am I missing something? Will this not do the trick: SELECT DISTINCT member_id FROM table WHERE specialty_id IN(6,33); Graham > -Original Message- > From: Johan Höök [mailto:[EMAIL PROTECTED] > Sent: 30 November 2004 19:56 > To: Mike Zornek > Cc: [EMAIL PROTECTED] > Subject: Re: Select m

RE: Help with query performance anomaly

2004-11-13 Thread Graham Cossey
Thanks for the advice Steven, I'll bear it in mind and do some reading. Graham > -Original Message- > From: Steven Roussey [mailto:[EMAIL PROTECTED] > Sent: 13 November 2004 02:52 > To: 'Graham Cossey' > Cc: [EMAIL PROTECTED] > Subject: RE: Help with qu

RE: Help with query performance anomaly (SOLVED)

2004-11-12 Thread Graham Cossey
It turns out that it appears to be a data discrepancy that caused the query optimiser to, well, not optimise. I thought the main table (r) with 3million records would be the problem, but it was table p with 3100 records on the live server and 3082 records on my dev pc that caused the problem. Alt

RE: Help with query performance anomaly

2004-11-11 Thread Graham Cossey
[snip] > > Have just run 'top' on the live server... > > Before running the query I get: > > 13:56:09 up 45 days, 11:47, 1 user, load average: 0.00, 0.28, 0.44 > 24 processes: 23 sleeping, 1 running, 0 zombie, 0 stopped > CPU0 states: 0.0% user 0.0% system0.0% nice 0.0% iowait 100.0% >

RE: Which PHP for MySQL 4.1

2004-11-11 Thread Graham Cossey
[snip] > > >Sorry, YMMV? What does that mean? > > > >Is there a reference somewhere for all these acronyms? > > > > > > Yes it's called Google. > Yep, as soon as I posted I knew I should not have :) It's late and I'm getting lazy... -- MySQL General Mailing List For list archives: http://l

RE: Which PHP for MySQL 4.1

2004-11-11 Thread Graham Cossey
[snip] > > of course, YMMV ... > [snip] Sorry, YMMV? What does that mean? Is there a reference somewhere for all these acronyms? Thanks Graham -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Help with query performance anomaly

2004-11-11 Thread Graham Cossey
^ Does not look good to me !! Comments? Advice? Thanks Graham > -Original Message- > From: Jamie Kinney [mailto:[EMAIL PROTECTED] > Sent: 11 November 2004 19:25 > To: Graham Cossey > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Help with query performance ano

RE: Help with query performance anomaly

2004-11-11 Thread Graham Cossey
[big snip] > > These are two different plans. Your development machine is using > the index > yr_mn_pc on the r table and is joining that table last. On your > production > server, the r table is joined second and is joined by the index PRIMARY. > Let me know how the ANALYZE TABLE I suggested in

RE: Help with query performance anomaly

2004-11-11 Thread Graham Cossey
> Thanks Shaun > > EXPLAIN shows the same 'possible keys' for each table but 'key' and > 'key-len' columns are different, as are the 'rows' as well of course. > > I guess this points to a probable difference in key definitions? > > Can 2 installations with the same table definitions produce differe

RE: Help with query performance anomaly

2004-11-11 Thread Graham Cossey
le definitions produce different results like this? Maybe something in the configs? Thanks Graham > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 11 November 2004 16:28 > To: Graham Cossey > Cc: [EMAIL PROTECTED] > Subject: Re: Help with

Help with query performance anomaly

2004-11-11 Thread Graham Cossey
Hi Can someone offer any advice on a strange problem I have at present... If I run a certain query (see below) on my local development PC using mysqlcc it returns in 3.7s. If I run the exact same query on my live webserver (again using mysqlcc) I have yet to get a result !! Both databases have

RE: Commercial Licensing Question

2004-10-20 Thread Graham Cossey
http://www.mysql.com/company/legal/licensing/commercial-license.html : "With a commercial non-GPL MySQL server license, one license is required per database server (single installed MySQL binary). There are no restrictions on the number of connections, number of CPUs, memory or disks to that one M