Re: very simple but slow query

2008-05-21 Thread Wakan
Thanks very much to all who suggest me to use a JOIN instead of the IN clause, which performances are very poor vs join ones, as I read in http://www.artfulsoftware.com/infotree/queries.php#568: Both the |IN()| and |EXISTS()| queries have to execute a table scan for each row in the table.

very simple but slow query

2008-05-20 Thread Wakan
Hi, can someone could explain where are problems in this query: EXPLAIN SELECT ID FROM ven_tes WHERE ID IN (SELECT ID FROM ven_tes WHERE ID_ven=6573) +++-+-++-+-+--+--+--+ | id | se

group by problem

2005-04-19 Thread Wakan
Hi, I've 2 tables of payments 1: payment emission (P: --> ID,ID_cli,tot) 2: part payments (A: --> ID,P_ID,val) I'd like to retrieve all payment emissions, with all relative part payments(with a left join), for all ID_cli and I'd like to calculate the rest to pay...like tot-SUM(val). but I

Re: join 1 of 2 table depending on a column value

2005-01-12 Thread Wakan
Let me know if this answers your question. If not, come back to the list and explain what you really want and I am sure that someone here can help. Shawn Green Database Administrator Unimin Corporation - Spruce Pine Wakan <[EMAIL PROTECTED]> wrote on 01/12/2005 09:27:40 AM: > HI, > I&#

join 1 of 2 table depending on a column value

2005-01-12 Thread Wakan
HI, I've 2 fields in a select query rif_CF, ID_CF... the rif_CF value (C or F) indicate the meaning of the ID_CF... IF rif_CF=C then the ID_CF is a customer ID, IF rif_CF=F the ID_CF is a furnisher ID. How can I join 2 tables (customer, and furnisher) in a query? SELECT ID_doc, data_doc, rif_CF,

negative decimal problem

2003-09-17 Thread Wakan
I bag your pardon if I post this question again, but I can't find a clear answer. I've Mysql version 3.23.41 and 4.0.12, and the manual says that for version > 3.23 the - sign and the decimal point, there's an extra space reserved. I've a decimal column : DECIMAL(5,2), and my problem (maybe manual

negative decimal problem

2003-09-17 Thread Wakan
I bag your pardon if I post this question again, but I can't find a clear answer. I've Mysql version 3.23.41 and 4.0.12, and the manual says that for version > 3.23 the - sign and the decimal point, there's an extra space reserved. I've a decimal column : DECIMAL(5,2), and my problem (maybe manual

negative decimal problem

2003-09-17 Thread Wakan
I bag your pardon if I post this question again, but I can't find a clear answer. I've Mysql version 3.23.41 and 4.0.12, and the manual says that for version > 3.23 the - sign and the decimal point, there's an extra space reserved. I've a decimal column : DECIMAL(5,2), and my problem (maybe manual

affected columns

2003-07-29 Thread Wakan
HI, is there a way to obtain only the affected columns after an update query? After an update query, that involves 10 columns, I know that only 2 columns are really updated (because the values of the other cols don't change). I need to know the names of that changed cols, for logging purpose. Someo

which are the updated column?

2003-07-29 Thread Wakan
HI, is there a way to obtain only the affected columns after an update query? After an update query, that involves 10 columns, I know that only 2 columns are really updated (because the values of the other cols don't change). I need to know the names of that changed cols, for logging purpose. Someo

Re: mysql socket problem in win98 (thanks for the help!)

2002-10-21 Thread Wakan
First of all, thanks to everyone for no reply and no help! If someone is interested, I've found that i Win9x systems, if there are persistent connections open, the system instead of used the same opened connection for the same session, it opens a new connection for each script call, and, because i

Re: Re: mysql socket problem in win98 (thanks for the help!)

2002-10-20 Thread Wakan
At 13.49 20/10/2002 +0200, you wrote: Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this message, and include the entire text o

mysql socket problem in win98

2002-10-18 Thread Wakan
HI, I'm on a win98 2ED system, running - Apache 1.3.26 + php 4.2.3 - Mysql 3.23.52 (started server is mysqld) I'm running some php scripts, that works with a database. Every script, makes a db_connect. It happens that, after a certain time (I don't know how much, and I don't know if it really invo

order by date error!!!

2002-02-27 Thread Wakan
Hi, I've noticed this problem, even if I don't know if it's really a mysql problem: if I store a date in standard format, in a date field, all kinds of ordering are OK. But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'), the order by clause attempt to order the new format incorr

how to retrieve a hierarchical structure

2002-02-18 Thread Wakan
Hi, can someone suggest the best way to perform a query that extract from a category table all the structure, like a filesystem? For example, I've a table of categorie like this: ID namedescr ID_parent and I've assigned -1 to the root category. I'd like to draw a directory-like structur

Automatic joins

2001-11-26 Thread Wakan
Hi, I'd like to ask for a reply to this (I hope not stupid) question: is there a way to set permanently relationship between tables, so in that way when I ask for something, Mysql automatically joins all tables involved in that relationship? (Like MSAccess, for example) -