SELECT lq.createdTS, um.username, CONCAT(lq.type, "\r\n", lq.executionTime, "\r\n", lq.userIP) as type, lq.query, lq.url
FROM (`_log_query` lq)
LEFT JOIN `tbl_usermaster` um ON `um`.`fldid`=`lq`.`userID`
WHERE `lq`.`createdTS` >= '2014-10-13'
AND `lq`.`createdTS` <= '2014-10-14'
AND `lq`.`companyID`  =  '110'
AND `lq`.`userID` =  '19'
AND `lq`.`type` =  'update'