Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 9, 2008, 8:25 pm
rate this thread
Ok, maybe I do not know how to search. But, putting MYSQL into
Google's Group Search does not return any MySQL groups....go figure.
So, the next best place......I have this query in my PHP script:
SELECT customer_count, DATE_FORMAT(customer_date,'%a') dow,
DATE_FORMAT(customer_date,'%c/%e') fmt_date FROM cust_stats WHERE
DATE_FORMAT(customer_date,'%a') = 'Fri' ORDER BY customer_date ASC;
What I want to do, is for customer_count, I want to subtract the value
from the previous value and get the result in the query.
So, say I have these records (for name sake)
John Doe | 14 | 2008-03-14
Jane Doe | 8 | 2008-04-01
Jack Doe | 12 | 2008-05-19
Jim Doe | 11 | 2008-06-10
I want to subtract Jane Doe from John Doe and get the result in the
query result. (-6)
I want to subtract Jack Doe from Jane Doe and get the result in the
query result. (4)
I want to subtract Jim Doe from Jack Doe and get the result in the
query result. (-1)
Can this be done?
There is no "maybe" about it! I put mysql into "Google's Group Search"
and comp.databases.mysql was the fourth one on the list.
If you're that bad at searching for answers to simple queries like
that, it may be an idea to give up on programming and do something
simpler, like cleaning windows.
- » database hangs in MyPHPAdmin/can't login to web site
- — Previous thread in » PHP Scripting Forum