Re: Challenging query....

2003-10-17 Thread Director General: NEFACOMP
; Sent: Thursday, October 16, 2003 19:41 Subject: RE: Challenging query > On Thu, 2003-10-16 at 17:42, Jeff McKeon wrote: > > Is there a way to generate a "line number" for a query return within the > > returned rows?? > > > > For instance, if I return 5 rows

Re: Challenging query....

2003-10-16 Thread Gabriel Ricard
ah, that will work fine. Jeff -Original Message- From: Gabriel Ricard [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2003 2:11 PM To: Jeff McKeon Cc: [EMAIL PROTECTED] Subject: Re: Challenging query On Thursday, October 16, 2003, at 02:04 PM, Jeff McKeon wrote: Do this quer

RE: Challenging query....

2003-10-16 Thread Jeff McKeon
te it to a file? Jeff > -Original Message- > From: Gabriel Ricard [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 16, 2003 2:11 PM > To: Jeff McKeon > Cc: [EMAIL PROTECTED] > Subject: Re: Challenging query > > > > On Thursday, October 16, 2003, at

Re: Challenging query....

2003-10-16 Thread Gabriel Ricard
ustomerID'] ] = $result['Revenue']; } The result will be a simple multi-dimensional array with a minimal SQL query and minimal application code. Jeff -Original Message- From: Gabriel Ricard [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2003 1:47 PM To: Jeff McKeon;

RE: Challenging query....

2003-10-16 Thread Jeff McKeon
t['CustomerID'] ] = $result['Revenue']; > } > > The result will be a simple multi-dimensional array with a > minimal SQL > query and minimal application code. Jeff > -Original Message- > From: Gabriel Ricard [mailto:[EMAIL PROTECTED] > Sen

Re: Challenging query....

2003-10-16 Thread Gabriel Ricard
icated if you have more than 26 clients :) but still doable. HTH Rory McKinley Nebula Solutions +27 82 857 2391 [EMAIL PROTECTED] "There are 10 kinds of people in this world, those who understand binary and those who don't" (Unknown) ----- Original Message - From: "Jeff McK

RE: Challenging query....

2003-10-16 Thread Diana Soares
On Thu, 2003-10-16 at 17:42, Jeff McKeon wrote: > Is there a way to generate a "line number" for a query return within the > returned rows?? > > For instance, if I return 5 rows from a query, is there a command or > function I can put in a query to add a column that contains the row > number retur

Re: Challenging query....

2003-10-16 Thread Rory McKinley
Rory McKinley Nebula Solutions +27 82 857 2391 [EMAIL PROTECTED] "There are 10 kinds of people in this world, those who understand binary and those who don't" (Unknown) - Original Message - From: "Jeff McKeon" <[EMAIL PROTECTED]> To: "Rory McKinley&qu

RE: Challenging query....

2003-10-16 Thread Jeff McKeon
> If you have a way to generate the query code dynamically > (e.g. using a loop in C, PHP etc.), you can build a query > using aliased tables : > > SELECT YEAR(a.date) AS year, MONTH(a.date) AS month, > SUM(a.revenue) AS cust1_rev, > SUM(b.revenue) AS cust2_rev, SUM(c.revenue) AS cust3_rev > F

Re: Challenging query....

2003-10-16 Thread Rory McKinley
2391 [EMAIL PROTECTED] "There are 10 kinds of people in this world, those who understand binary and those who don't" (Unknown) - Original Message - From: "Jeff McKeon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 16, 2003 4:21 PM Su

RE: Challenging query....

2003-10-16 Thread Jeff McKeon
6, 2003 11:40 AM > To: Jeff McKeon > Cc: [EMAIL PROTECTED] > Subject: Re: Challenging query > > > I think the closest you can get is something like this: > > SELECT YEAR(TheDate) AS Year,MONTH(TheDate) AS > Month,CustomerName,CustomerID,SUM(Revenue*Quantity) AS

RE: Challenging query....

2003-10-16 Thread Jeff McKeon
w | blah | blew | | row | blah | blew | Jeff > -Original Message- > From: Gabriel Ricard [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 16, 2003 11:40 AM > To: Jeff McKeon > Cc: [EMAIL PROTECTED] > Subject: Re: Challenging query >

Re: Challenging query....

2003-10-16 Thread Gabriel Ricard
I think the closest you can get is something like this: SELECT YEAR(TheDate) AS Year,MONTH(TheDate) AS Month,CustomerName,CustomerID,SUM(Revenue*Quantity) AS Revenue FROM rev GROUP BY Year, Month ORDER BY Year,Month,CustomerID A table with this data: ++--++--

Challenging query....

2003-10-16 Thread Jeff McKeon
I have a table that contains customer revenue information. REVENUE TABLE: Date, customer name, CustomerID, revenue, quantity I need to create a query that will produce the following result Year, Month, Customer1_rev, customer2_REV, customer3_rev, etc... 2002, 01, 0, $30.00, $15.00 2