Re: Mambo SQL query help.... Please

2004-11-24 Thread Scott Stroz
This looks like a job for OLAP. On Tue, 23 Nov 2004 15:31:07 -0600, Mark W. Breneman <[EMAIL PROTECTED]> wrote: > > John, I thought about that and also just caching the results, but that will > not work in my case. I fear that I did not explain this very well. This is a > dynamic query that can

Re: Mambo SQL query help.... Please

2004-11-23 Thread Jochem van Dieten
Jochem van Dieten wrote: > > But all of these are just (imperfect) means to an end: getting a > good execution plan. I'll see if I can dig up some high level > literature on database internals. While Googling for an easy howto I had little success: most general reading material is database spe

Re: Mambo SQL query help.... Please

2004-11-23 Thread Jochem van Dieten
Mark W. Breneman wrote: > > Is there a better way to get the end result then using the inline queries? With a helicopter view of the problem I can think of various execution plans that could make sense in your situation. But it all depends on the schema, cardinality and distribution of the dat

RE: Mambo SQL query help.... Please

2004-11-23 Thread Mark W. Breneman
.9770 -Original Message- From: Burns, John D [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 3:36 PM To: CF-Talk Subject: RE: Mambo SQL query help Please Not really, unless you did stored procedures or something. I guess you could also use a view for each type of data you want to

RE: Mambo SQL query help.... Please

2004-11-23 Thread Mark W. Breneman
-Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 3:47 PM To: CF-Talk Subject: Re: Mambo SQL query help Please Mark W. Breneman wrote: > > So my question is where do I get started rewriting this query. If that is an option,

Re: Mambo SQL query help.... Please

2004-11-23 Thread Jochem van Dieten
Mark W. Breneman wrote: > > So my question is where do I get started rewriting this query. If that is an option, start with optimizing the data model. > First off I can see that the yes, No and NA should be converted to a number. To a BOOLEAN. > The DISTRICT also needs to be converted to a

RE: Mambo SQL query help.... Please

2004-11-23 Thread Burns, John D
to access the database. John -Original Message- From: Mark W. Breneman [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 4:31 PM To: CF-Talk Subject: RE: Mambo SQL query help Please John, I thought about that and also just caching the results, but that will not work in my case.

RE: Mambo SQL query help.... Please

2004-11-23 Thread Mark W. Breneman
John, I thought about that and also just caching the results, but that will not work in my case. I fear that I did not explain this very well. This is a dynamic query that can get the results for a different years, different ages and different school districts. The user can pick several items fro

RE: Mambo SQL query help.... Please

2004-11-23 Thread Burns, John D
ecute that however often you want to populate the temporary table with the newest values. Then your code just does a select * from temporaryTable. John -Original Message- From: Mark W. Breneman [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 23, 2004 4:02 PM To: CF-Talk Subject: Mambo SQL

Mambo SQL query help.... Please

2004-11-23 Thread Mark W. Breneman
I just inherited a project that has a very very large SQL count query. Now when I say very large I mean very large. What I have posted here is only 4 blocks of the 35 total blocks of SQL code in this one query. The total query takes about 120 seconds to run and often takes down the CF server. This

RE: SQL Query Help Please.

2004-10-12 Thread Al Everett
> 2.) Can someone please suggest a good book on SQL syntax "Teach Yourself SQL in 10 Minutes" by Ben Forta. ISBN 0-672-32128-9 ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com [Todays Threads] [This Message] [Subscript

Re: SQL Query Help Please.

2004-10-12 Thread Nomad
Thanks Umer & Others, You guys have been of great help. Will try the query today.. Regards, Mark - Original Message - From: "Umer Farooq" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, October 11, 2004 8:17 PM Subject: Re: SQL Que

RE: SQL Query Help Please.

2004-10-12 Thread Cornillon, Matthieu (Consultant)
2.) Can someone please suggest a good book on SQL syntax that will clear thing up for me. Other beginner resources: 1) http://www.sqlcourse.com/ 2) http://sqlcourse2.com/ 3) http://www.freeprogrammingresources.com/sql.html   (links to many others) [Todays Threads] [This Message] [Sub

Re: SQL Query Help Please.

2004-10-11 Thread Umer Farooq
Here you.. go.. returns.. orderId, date, customerId, customer name, paymentReceived, amount due (per order)... ,     SELECT orders.orderId, order.orderDate, orders.customerID,    customers.customerName, customerPayment.PaymentReceived    (SELECT sum(unitPrice * quantity)   

Re: SQL Query Help Please.

2004-10-11 Thread Umer Farooq
   4 11/10/20044740 > 400 > Company5  4 11/10/2004  26400 > 400 > Company5  4 11/10/2004544600 > 400 > - Original Message - > From: "Josh" <[EMAIL PROTECTED]> > To: "CF-

Re: SQL Query Help Please.

2004-10-11 Thread Nomad
: "Josh" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, October 11, 2004 6:07 PM Subject: Re: SQL Query Help Please. > Here's a start, though you'll have to explain your tables and your > calculations further. > > SELECT > c.Cu

Re: SQL Query Help Please.

2004-10-11 Thread Josh
Here's a start, though you'll have to explain your tables and your calculations further. SELECT c.Customername, a.Orderid, a.Orderdate, ( where is this being stored? AmountReceived maybe this could be d.PaymentReceived  AS AmountReceived ? ), ( put your formula for calculating AmountDue her

Re: SQL Query Help Please.

2004-10-11 Thread Umer Farooq
Hi, http://www.techonthenet.com/access/queries/joins1.htm For beginner I would suggest.. SAMS SQL in 21 Days.. and Google.. :-) Nomad wrote: > Hello! > > I am trying to create a join of four tables to get data from a db in the > format I want. > > The Database tables and fields are: > Orders

SQL Query Help Please.

2004-10-11 Thread Nomad
Hello! I am trying to create a join of four tables to get data from a db in the format I want. The Database tables and fields are: Orders (orderid,customerid,Orderdate) OrderDetails(Orderid,UnitPrice,productid,quantity) Customer(Customerid, customername, address) CustomerPayments(orderid,PaymentR