0

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.

1 Answer 1

1

THis should work:

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

Because you forgot one '

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.