SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "ORDER"
LINE 4:                                         ORDER BY a.id ASC LI...
                                                ^ (Connection: pgsql, SQL: SELECT a.id,a.doc_number,a.date,a.url_payment_proof,a.amount,a.counting_notify,b.name AS client_name
                                        FROM t_client_deposit a JOIN m_clients b ON b.id=a.client_id
                                        WHERE a.status = 'OPEN' AND --(a.date_notify is null OR a.date_notify <= NOW() - INTERVAL '24 hours') --AND a.f_notify = 0
                                        ORDER BY a.id ASC LIMIT 1
                                    )