Complex group/join query

2009-04-09 Thread Brendan Moran
I'm trying to create a rather (what I consider to be) complex analysis query. It should use data from three tables that contain measurements and write the results back to a fourth table. There are three measurement tables: metrica, metricb, and metricc.  There's one table which contains a summar

Partitioning suggestion/workaround needed

2009-04-09 Thread David Sparks
Hi all, I'm just creating my first partitioned table and have run into a bit of a snag. The table primary key is a double and I want to create partitions based on ranges of the key. I have read the Partition Limitations section in the docs which states that the partition key must be, or resolve

Re: success return from mysql_query() when error return was expected

2009-04-09 Thread Thomas Spahni
On Wed, 8 Apr 2009, Pete Wilson wrote: Hi everyone -- I'm a MySQL noob. I have MySQL queries in my C code and I was surprised to find I'm getting a success return from: mysql_query(pmysql, "select * from usrs where(usr=\"illegal name\""); In this table called "usrs," "usr" is the primary k

displaying a specific row within a "group by"

2009-04-09 Thread Andy Sy
Consider the ff. table: ++--+--+ | game | rank | date | ++--+--+ | GTA| 11 | 20081001 | ++--+--+ | SPORE | 1 | 20081103 | ++--+--+ | SPORE | 2 | 20091001 | ++--+--+ | SINSOL |

Re: displaying a specific row within a "group by"

2009-04-09 Thread Peter Brawley
Andy >I want a single SQL query that will return the latest >ranking for each game: See "Within-group aggregates" at http://www.artfulsoftware.com/infotree/queries.php. PB - Andy Sy wrote: Consider the ff. table: ++--+--+ | game | rank | date | ++

Re: displaying a specific row within a "group by"

2009-04-09 Thread Olexandr Melnyk
Also: http://jan.kneschke.de/projects/mysql/groupwise-max On Thu, Apr 9, 2009 at 8:46 PM, Peter Brawley wrote: > Andy > >>I want a single SQL query that will return the latest >>ranking for each game: > > See "Within-group aggregates" at > http://www.artfulsoftware.com/infotree/queries.php. > > P

S L O W query over internet

2009-04-09 Thread Duncan, Kurt (MCUSA)
We are running a remote service and have an application that queries a mysql database over the public internet. The ping test shows <60ms but the queries take 40 seconds to 2 minutes to run at times. When we run the same query using a local machine with <2ms it runs fast. I have searched the

db is bring dropped, binlog help

2009-04-09 Thread John Sun
Hi folks, We're experiencing a really bizarre thing. One of our mysql 5.0 databases is mysteriously and constantly being dropped. This is a cap from our binlog: #090409 15:09:13 server id 1 end_log_pos 326997 Query thread_id=9923 exec_time=1 error_code=0 SET TIMESTAMP=1239304153/*

Re: db is bring dropped, binlog help

2009-04-09 Thread Andy Shellam
Hi John, I would almost certainly suspect some form of foul play, whether that be internal (i.e. an employee/colleague) or network intrusion. As you've figured the first thing to do is check which MySQL account is dropping the database. You already have the timestamp in your binlog so what y

Re: db is bring dropped, binlog help

2009-04-09 Thread John Sun
Andy, Thanks a ton for the quick feedback. I will turn on query logging and give it a go! Thanks, John On Thu, Apr 9, 2009 at 6:16 PM, Andy Shellam wrote: > Hi John, > > I would almost certainly suspect some form of foul play, whether that be > internal (i.e. an employee/colleague) or network i