Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- cdr.*,
- (SELECT agent FROM asterisk.queue_log AS q WHERE q.callid=cdr.uniqueid ORDER BY id DESC LIMIT 1) as agent,
- (SELECT event FROM asterisk.queue_log AS q WHERE q.callid=cdr.uniqueid ORDER BY id DESC LIMIT 1) as event,
- (SELECT data1 FROM asterisk.queue_log AS q WHERE q.callid=cdr.uniqueid ORDER BY id DESC LIMIT 1) as data1
- FROM
- asterisk.cdr AS cdr
- WHERE
- cdr.dcontext!='incoming' and cdr.dcontext!='radko_aut' and cdr.calldate>='2015-03-31 00:00:00' and cdr.calldate<='2015-03-31 23:59:59' and (cdr.src LIKE '%560003%' or cdr.userfield LIKE '%560003%' or cdr.dst LIKE '%560003%')
- ORDER BY
- uniqueid DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement