Re: Some help with a complex query

2003-11-17 Thread Roger Baklund
* Elisenda [...] > So, the good way to write joins will be as follows, doesn't it? > > FASE.SQL_ID_CE=CA.CA_ID_CE AND > FASE.PR_PP_ID_COORD=PP.PP_ID_PP AND > CA.CA_ID_CE=CE.CE_ID_CE AND > FASE.AU_PR_AULA=AU.AU_AULA Those are the exact same criteria as you had, only in a different order, isn't it?

Re: Some help with a complex query

2003-11-15 Thread Elisenda
Roger, > * Elisenda > [...] >> The explain select says as follows: > [...] > > I re-formatted the query and the EXPLAIN output for readability: Sorry for not re-formatted the query, I've learn it for next time. Well, I've learn a lot with your lessons. > > Select FASE.PR_Date_Visita_2, CE.CE_

Re: Some help with a complex query

2003-11-14 Thread Roger Baklund
* Elisenda [...] > The explain select says as follows: [...] I re-formatted the query and the EXPLAIN output for readability: Select FASE.PR_Date_Visita_2, CE.CE_Centro, CE.CE_Domicilio, CE.CE_CP, CE.CE_Poblacion, CE.CE_Capital, CE.CE_PROV, CE.CE_CCAA, CA.CA_Horario, PP.PP_Contacto, PP.PP_C

Re: Some help with a complex query

2003-11-14 Thread Elisenda
Roger, Your help was fantastic. It seems that it goes better. At the end I achieve some result but not all I need. The explain select says as follows: EXPLAIN Select FASE.PR_Date_Visita_2, CE.CE_Centro, CE.CE_Domicilio, CE.CE_CP, CE.CE_Poblacion, CE.CE_Capital, CE.CE_PROV, CE.CE_CCAA,CA.CA_Hora

Re: Some help with a complex query

2003-11-12 Thread Roger Baklund
* Elisenda > The problem is that it 's too slow and the result doesn't appear. > I am going to try to explain the query. Please do that using the EXPLAIN SELECT statement: http://www.mysql.com/doc/en/EXPLAIN.html > This will show what index is beeing used on the different joins, and approximatel

Re: Some help with a complex query

2003-11-12 Thread Elisenda
I'm sorry I didn't explain anything. The problem is that it 's too slow and the result doesn't appear. I am going to try to explain the query. Fields from Table FASE: (300.000 records) ID INT AUTO_INCREMENT NOT NULL PRIMARY KEY, SQL_ID_PY char(6), SQL_ID_CE char(6), PR_flag INT, PR_Date_Visita

Re: Some help with a complex query

2003-11-11 Thread Leo
it would help alot if you dump the table structure for us - Original Message - From: Elisenda To: [EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 7:10 PM Subject: Some help with a complex query I have a query which tries to select different fields from 5 different

Re: Some help with a complex query

2003-11-11 Thread Roger Baklund
* Elisenda > I have a query which tries to select different fields from 5 different > tables. > > In WHERE part I have write all the conditions and relationships. > Perhaps two many. Joining 5 tables should not be a problem, but having indexes on the relevant columns may be essential, especial

Some help with a complex query

2003-11-11 Thread Elisenda
I have a query which tries to select different fields from 5 different tables. In WHERE part I have write all the conditions and relationships. Perhaps two many. The main table for me is FASE. From this table I try to find all the other information. I guess I'm doing something wrong but I d