selecting with LIMIT and including the total?

2001-07-03 Thread nsabbi
Hi, how to query a list of records limiting the score, but including the TOTAL of records satisfying the condition, all in one statement? i.e. SELECT title FROM news WHERE cond1 LIMIT 1, 10 plus SELECT count(*) from NEWS WHERE cond1 all in one. Thanks in advance Nico

HAVING strangeness in InnoDB

2001-07-06 Thread nsabbi
Hi, the following query yields: mysql> SELECT DISTINCT (@c:=@c+1), p.*, count(k.keywords) AS found FROM keywords k, poll_keywords pk, poll p , section_poll sp WHERE 1 AND k.keywords IN ('quarto') AND k.id_keyword=pk.id_keyword AND pk.id_poll=p.id_poll AND sp.id_section IN (29, 0, 1, 2, 3, 4,

Re: HAVING strangeness in InnoDB

2001-07-06 Thread nsabbi
Hi, this is a follow-up to the previous message. As far as I've understood when Innodb parses a Having clause it creates a temporary table where it stores the results of the query satisfying all the conditions except the HAVING clause, then it makes a SELECT * from ... WHERE having_clause on th

Re: Can't find record in '#sql45e7_70df_3'

2001-07-23 Thread nsabbi
I had the same problems when executing queries with an HAVING clause and TEXT fields SELECTed, at least using InnoDB tables. If you are in the same position you can use substring(text_field, 128) to solve your problem, at least partially. Hope it helps Nico On Fri, 1

THANKS for having fixed DISTINCT ... HAVING bug...

2001-08-27 Thread nsabbi
... you are really very kind and helpful! Now I can avoid managing temp tables. Thanks very much, Nico Sabbi - Before posting, please check: http://www.mysql.com/manual.php (the manual)

Query mych slower when using index (Innodb)

2001-10-31 Thread nsabbi
Hi, I have the following tables : CREATE TABLE articoli ( codice varchar(16) PRIMARY KEY, descrizione varchar(255), marca varchar(255) NOT NULL, misure varchar(32), pesofloa

Re: Query mych slower when using index (Innodb)

2001-11-02 Thread nsabbi
without the index on keywords.codice: mysql> show index from keywords; +--++--+--+-+---+-+--++-+ | Table| Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part |

innodb and use of indices

2001-11-20 Thread nsabbi
HI, I have two problems: 1) I have the following table: desc users; +--+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra | +--+--+--+-+-+---+ | username | varchar(128) | | PRI |

concated comparisons stopped working properly

2001-06-14 Thread nsabbi
mysql> select (1 < 5 < 3); +-+ | (1 < 5 < 3) | +-+ | 1 | +-+ 1 row in set (0.00 sec) mysql> select (1 < 5 and 5 < 3); ++ | (1 < 5 and 5 < 3) | ++ | 0 | ++ 1 row in set (0.0