I've got an SQL query which I can not make work: it's like this:
select creation_time as date, abs(USD_amount) as amount
from pending_transactions as p
inner join users as u
on u.user_id = p.user_id
where (p.transaction_status = 'black' or p.transaction_status = 'green' or
p.transaction_status = 'gray) and u.referrer = 309 and
creation_time > '0000-00-00 00:00:00' order by creation_time asc
I use MySQLdb in Python to access a DB but it says that it's wrong. If anyone could help me to make it work it would be so much appreciated.