Tudor is a techie turned manager who fights like mad to keep his tech skills honed and relevant. Everything from web hosting, networking, *nix and the like. Constantly developing and co-ordinating with others to make the web a better (and easier to use) place.
Thursday, 10th Jan 2013 Posted @ 15:25
Wrote this little beauty this morning:
SELECT
CONCAT('0', called_number) AS called,
calling_number AS calling,
CONCAT(DATE_FORMAT(startdate,'%d/%m/%Y'),' ',starttime) AS start,
CONCAT(DATE_FORMAT(startdate,'%d/%m/%Y'),' ',ADDTIME(starttime,sec_to_time(3))) AS connect,
CONCAT(DATE_FORMAT(startdate,'%d/%m/%Y'),' ',ADDTIME(starttime,sec_to_time(duration+3))) AS end,
duration
FROM cdr
WHERE duration != '0'
AND calling_number NOT IN (
SELECT sipnum FROM sip_numbers)
AND CONCAT('0',called_number) NOT IN (
SELECT sipnum FROM sip_numbers);
[ no comments : Add ]