SELECT `NETWORK_NEW_LEFT`.`REAL_NAME` AS `子一市场真实姓名`,`NETWORK_NEW_LEFT`.`USER_NAME` AS `子一市场编号`,`NETWORK_NEW_LEFT`.`USER_ID` AS `子一市场用户ID`,`NETWORK_NEW_MIDDLE`.`REAL_NAME` AS `子二市场真实姓名`,`NETWORK_NEW_MIDDLE`.`USER_NAME` AS `子二市场编号`,`NETWORK_NEW_MIDDLE`.`USER_ID` AS `子二市场用户ID`,`NETWORK_NEW_RIGHT`.`REAL_NAME` AS `子三市场真实姓名`,`NETWORK_NEW_RIGHT`.`USER_NAME` AS `子三市场编号`,`NETWORK_NEW_RIGHT`.`USER_ID` AS `子三市场用户ID`,`UP`.`SURPLUS_1L` AS `业绩累计表一市场结余`,`UP`.`SURPLUS_2L` AS `业绩累计表二市场结余`,`UP`.`SURPLUS_3L` AS `业绩累计表三市场结余`,`U`.`USER_NAME` AS `业绩累计用户编号`,`U`.`REAL_NAME` AS `业绩累计用户真实姓名`,`UP`.`USER_ID` AS `业绩累计用户ID`,`PP`.`PV_1L` AS `期业绩一市场`,`PP`.`PV_2L` AS `期业绩二市场`,`PP`.`PV_3L` AS `期业绩三市场` FROM `AR_USER_PERF` AS `UP`
LEFT JOIN `AR_USER` AS `U` ON `U`.`ID` = `UP`.`USER_ID`
LEFT JOIN `AR_PERF_PERIOD` AS `PP` ON `PP`.`USER_ID`=`UP`.`USER_ID` AND `PP`.`PERIOD_NUM`=100
LEFT JOIN (SELECT `AR_USER`.`USER_NAME`,`AR_USER`.`REAL_NAME`,`AR_USER_NETWORK_NEW`.`USER_ID`,`AR_USER_NETWORK_NEW`.`RELATIVE_LOCATION`,`AR_USER_NETWORK_NEW`.`PARENT_UID` FROM `AR_USER_NETWORK_NEW`
JOIN `AR_USER` ON `AR_USER`.`ID`=`AR_USER_NETWORK_NEW`.`USER_ID`
) AS `NETWORK_NEW_LEFT` ON `NETWORK_NEW_LEFT`.`PARENT_UID`=`UP`.`USER_ID` AND
`NETWORK_NEW_LEFT`.`RELATIVE_LOCATION`=1
LEFT JOIN (SELECT `AR_USER`.`USER_NAME`,`AR_USER`.`REAL_NAME`,`AR_USER_NETWORK_NEW`.`USER_ID`,`AR_USER_NETWORK_NEW`.`RELATIVE_LOCATION`,`AR_USER_NETWORK_NEW`.`PARENT_UID` FROM `AR_USER_NETWORK_NEW`
JOIN `AR_USER` ON `AR_USER`.`ID`=`AR_USER_NETWORK_NEW`.`USER_ID`
) AS `NETWORK_NEW_MIDDLE` ON `NETWORK_NEW_MIDDLE`.`PARENT_UID`=`UP`.`USER_ID` AND
`NETWORK_NEW_MIDDLE`.`RELATIVE_LOCATION`=2
LEFT JOIN (SELECT `AR_USER`.`USER_NAME`,`AR_USER`.`REAL_NAME`,`AR_USER_NETWORK_NEW`.`USER_ID`,`AR_USER_NETWORK_NEW`.`RELATIVE_LOCATION`,`AR_USER_NETWORK_NEW`.`PARENT_UID` FROM `AR_USER_NETWORK_NEW`
JOIN `AR_USER` ON `AR_USER`.`ID`=`AR_USER_NETWORK_NEW`.`USER_ID`
) AS `NETWORK_NEW_RIGHT` ON `NETWORK_NEW_RIGHT`.`PARENT_UID`=`UP`.`USER_ID` AND
`NETWORK_NEW_RIGHT`.`RELATIVE_LOCATION`=3
;