RE: Best choice for index

2001-10-23 Thread Ralph Graulich
>> SELECT id_team, >> sum(IF(m.id_visitor = t.id_team,m.visitor_score, >> m.home_score)) AS But_pour, >> sum(IF(m.id_visitor != t.id_team,m.visitor_score, >> m.home_score)) AS But_contre >> FROM tab_teams t, tab_matchs m >> WHERE

DISTINCT - ORDER BY fields change result set

2001-09-30 Thread Ralph Graulich
Hi, I encountered a problem with a DISTINCT query (mySQL-3.23.42). I need to order by a field not contained in the field set of the SELECT clause. The following query works correctly: SELECT DISTINCT p.lastchanged AS lastchanged, p.dam_id AS dam_id, d.dam AS dam,

Re: Query question!

2001-09-26 Thread Ralph Graulich
>Does anyone know how to write a query to get out the sum of a whole >table column? SELECT sum() FROM {WHERE }; Also see the manual. :wq! Ralph - Before posting, please check: http://www.mysql.com/manual.php (the manu

mySQL 4

2001-09-26 Thread Ralph Graulich
Hi, just read about the UNION operator beging supported with mySQL 4. How far are those operators implemented yet? Will there be any chance that UNION ALL and INTERSECT will be supported, too? And last but not least I want to try mySQL 4 but can't find any download link yet. Where can I downloa

Re: Inno-DB, updating table problem

2001-08-26 Thread Ralph Graulich
>> the table becomes corrupted. Is this some limitation of inno DB or should I >> separate the UPDATE process in two separate UPDATE statements? >It's a known and confirmed bug that will be fixed in 3.23.42. There >was an announcement just posted about this a few minutes ago. Hi Jeremy, thanks

Inno-DB, updating table problem

2001-08-26 Thread Ralph Graulich
Hi, recently I converted a table containing a large amount of text fields from myISAM to inno-DB and encountered a problem I can't help with. The table structure consists of: textref_id INT(12) UNSIGNED textref_cat_id INT(12) UNSIGNED textgroup_key CHAR(5) NOT NU

Re: Can I do this ?

2001-05-24 Thread Ralph Graulich
Hi Carlos, >SELECT * FROM some_table WHERE field1 = 1 AND field2 > 0 >ORDER BY CONCAT(field1,field2) LIMIT 1 You have to give the concatenated field an alias name and use it in the SELECT-subpart of your query, e.g. SELECT field1, field2, concat(field1,field2) AS sortvar1 WHERE field1=1 AND fi

Re: Reg. Synchronization between MySQL DBs

2001-03-28 Thread Ralph Graulich
Hi, >Does anyone know an automated way of keeping two MySQL db's (located on >different machines) in sync? A small window of non-sync could be acceptable. Read about "replication" in the corresponding chapters in the online manual of mySQL (http://www.mysql.com/) -> Documentation. Regards ...

Re: Views !!

2001-03-27 Thread Ralph Graulich
Hi, >How may create a view in mysql, o make some seem to the queiries in >access !!! As discussed already many times over and over again and as it can be read in the mySQL documentation (http://www.mysql.com) views are (not yet) implemented in the current 3.23.36 version. Regards ... Ralph ...

Re: MySQL 3.23.34a - "Lost connection to MySQL server duringquery"

2001-03-12 Thread Ralph Graulich
Hi Jordan, >Well... today I can't seem to reproduce the problem anymore. :/ I was >getting it very frequently yesterday (on almost every try). I'm not sure >what has changed since then. I'll let you know if the problem happens again >and try to narrow down the exact steps to reproduce. Is it po

What index is needed to speed up query?

2001-02-24 Thread Ralph Graulich
Hi folks, after having carefully tuned all statements within a larger web based application rewriting SQL statements and optimizing them by adding indices, there are still two statements left, which are awkward concerning performance. Maybe I am just too blind to see how to get them working fast