I try to find how many times a person did order and what is the day difference between it (second step):
Table is called
customer_email created_at status
a(at)a.com 12.1.10 complete
b(at)a.com 14.2.10 cancelled
c(at)a.com 16.1.10 complete
a(at)a.com 18.1.10 complete
c(at)a.com 18.1.10 complete
b(at)a.com 20.1.10 complete
Now I want that SQL shows me the a(at)a.com person and all the dates this person ordered with the status complete. So for a(at)a.com I want the output 12.1 and 18.1.
If i put:
SELECT customer_email, created_at
WHERE 'status' = 'complete'
Group by customer_email
It only shows me the first created_at date because I know its only a single row.But is there a way it shows me all the date in more than one row? In a second step I do wana callculate the difference between the first and the following orders but I think Ill use excel afterwards. Or is there a callculation in MySql?
Thanks very much, i just getting started with mysql and its quit a univers for me