Jump to content


Check out our Community Blogs

lol33d

Member Since 05 May 2010
Offline Last Active Nov 19 2013 06:32 PM
-----

#629580 Mysql Query -> Error

Posted by lol33d on 11 May 2012 - 01:58 AM

Hi guys

i have 2 tables and is joins

my records with active status is max up 2000 Records in days

this is my query
:

SELECT `tms`.`mxID`, `tms`.`mxNAME`, `tms`.`mxBACKID`,

(SELECT COUNT(`tmh21`.`mxlID`) FROM `tbl01` `tms21` LEFT OUTER JOIN `tbl02` `tmh21` ON `tms21`.`mxID` = `tmh21`.`mxlBACKID` WHERE `tmh21`.`mxlBACKID` = `tmh`.`mxlBACKID` AND `tmh21`.`mxlCNAME` = `tmh`.`mxlCNAME` AND `tmh21`.`mxlSTATUS` = 'ACTIVE' AND `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms21`.`mxBACKID`, `tms21`.`mxNAME`) AS `dbsActive`,

(SELECT COUNT(`tmh221`.`mxlID`) FROM `tbl01` `tms221` LEFT OUTER JOIN `tbl02` `tmh221` ON `tms221`.`mxID` = `tmh221`.`mxlBACKID` WHERE `tmh221`.`mxlBACKID` = `tmh`.`mxlBACKID` AND `tmh221`.`mxlCNAME` = `tmh`.`mxlCNAME` AND `tmh221`.`mxlSTATUS` = 'WIN' AND `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms221`.`mxBACKID`, `tms221`.`mxNAME`) AS `dbsWin`,

(SELECT COUNT(`tmh22`.`mxlID`) FROM `tbl01` `tms22` LEFT OUTER JOIN `tbl02` `tmh22` ON `tms22`.`mxID` = `tmh22`.`mxlBACKID` WHERE `tmh22`.`mxlBACKID` = `tmh`.`mxlBACKID` AND `tmh22`.`mxlCNAME` = `tmh`.`mxlCNAME` AND `tmh22`.`mxlSTATUS` = 'INACTIVE' AND `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms22`.`mxBACKID`, `tms22`.`mxNAME`) AS `dbsInActive`,

(SELECT COUNT(`tmh23`.`mxlID`) FROM `tbl01` `tms23` LEFT OUTER JOIN `tbl02` `tmh23` ON `tms23`.`mxID` = `tmh23`.`mxlBACKID` WHERE `tmh23`.`mxlBACKID` = `tmh`.`mxlBACKID` AND `tmh23`.`mxlCNAME` = `tmh`.`mxlCNAME` AND `tmh23`.`mxlSTATUS` = 'CANCEL' AND `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms23`.`mxBACKID`, `tms23`.`mxNAME`) AS `dbsCanc`,

(SELECT ROUND(EXP(SUM(LOG(`mxlNUM`))), 2) FROM `tbl01` `tms233` LEFT OUTER JOIN `tbl02` `tmh233` ON `tms233`.`mxID` = `tmh233`.`mxlBACKID` WHERE `tmh233`.`mxlBACKID` = `tmh`.`mxlBACKID` AND `tmh233`.`mxlCNAME` = `tmh`.`mxlCNAME` AND `tmh233`.`mxlSTATUS` = 'WIN' AND `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms233`.`mxBACKID`, `tms233`.`mxNAME`) AS `dbsOdds`

FROM `tbl01` `tms` LEFT OUTER JOIN `tbl02` `tmh` ON `tms`.`mxID` = `tmh`.`mxlBACKID` WHERE `tms`.`mxSTATUS` = 'ACTIVE' GROUP BY `tms`.`mxBACKID`, `tms`.`mxNAME`


i have 2 errors in some hosting:

err1:
#1053 - Server shutdown in progress

err2:

#1317 - Query execution was interrupted

please help me
  • 1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download