In my project, I need make a Column with Concat information, like this: CONCAT('SIP/', name) AS sipAgent.
And this works, but when i try to make a INNER JOIN with the column sipAgent, has error :(
And after inner join i need to SUM the results for each result of
like that:
----------------------------------
| NAME | sipAgent | notAnswered |
----------------------------------
| aaa | SIP/aaa | 132 |
| bbb | SIP/bbb | 50 |
----------------------------------
Name is the reference of agent, sipAgent is 'SIP/' + name, and noAnswered is the number of rows returned in a inner join.
Here is my 'test-query':
SELECT *, CONCAT('SIP/', tab_sippeers.name) AS sipAgent, SUM(queue_log.event) as notAnswered
FROM 'ipbx.tab_sippeers'
join 'queue_log' on tab_sippeers.sipAgent = queue_log.agent
But, is returning error... Sorry for bad english, and thanks alot for help!