Re: INNER JOIN across multiple tables appear very slow.

2005-01-24 Thread Jigal van Hemert
From: "Michael Stassen" > 2) In general, you should'nt put things in the JOIN condition which are not > part of the JOIN criteria. For example, the condition "c.salescode = > '$salescode_param'" is a restriction on which rows in c to consider, not a > condition of the JOIN to t or tt, so it belon

Re: INNER JOIN across multiple tables appear very slow.

2005-01-23 Thread sam wun
Hi Michael, Thank you for being so kind to explain the problem to me. Michael Stassen wrote: sam wun wrote: sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = "SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolu

Re: INNER JOIN across multiple tables appear very slow.

2005-01-23 Thread Michael Stassen
sam wun wrote: sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = "SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolume),2) 'PastSales Quantity', ROUND(avg(tt.salesvolume),2) 'Sales Quantity', R

Re: INNER JOIN across multiple tables appear very slow.

2005-01-22 Thread sam wun
sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = " SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolume),2) 'PastSales Quantity', ROUND(avg(tt.salesvolume)