Hi All,

Is there a faster way of doing this query

SELECT t1.to_uri as to_uri, t1.from_uri as from_uri, t1.sip_from as sip_from, t1.username as
username, DATE(t1.time) as startdate, t1.time as start, t2.time as stop,
TIMEDIFF(t2.time,t1.time) as timediff FROM acc AS t1 INNER JOIN
acc AS t2 ON t1.sip_callid = t2.sip_callid AND ((t1.fromtag = t2.fromtag AND t1.totag = t2.totag) OR (t1.fromtag = t2.totag AND t1.totag = t2.fromtag)) LEFT JOIN acc AS t3 ON t1.sip_callid = t3.sip_callid AND ((t1.fromtag = t2.fromtag AND t1.totag = t2.totag) OR (t1.fromtag = t2.totag AND t1.totag = t2.fromtag)) AND t3.sip_method='INVITE' AND t1.time > t3.time WHERE t1.sip_method='INVITE' AND t2.sip_method='BYE' AND t3.sip_method IS NULL AND ((t1.sip_status ='200' and t2.sip_status='200') AND (YEAR(t1.time) = '2006' AND MONTH(t1.time)='9' AND SUBSTRING_INDEX(t1.sip_callid,'@',-1)='210.1.71.51')) order by t1.time

what i really want to do is get the IP address part of t1.sip_callid, is there a faster way of extracting it?
here is a sample string in t1.sip_callid

[EMAIL PROTECTED]

TIA

Regards,
Nhadie

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to