美好的一天,
有人可以向我解释以下语法在做什么吗?我了解它之前要连接的表的所有内容,但是在这种情况下,它不是要连接的表,它看起来像是一个选择,我对它要选择的内容感到非常困惑。
LEFT OUTER JOIN (SELECT PARTRACKINFO.INVLOGID AS INVLOGID, GROUP_CONCAT(PARTRACKINFO.TRACKVALUE) AS TRACKVALUE
FROM (SELECT TIINVENTORYLOG.INVENTORYLOGID AS INVLOGID, CONCAT(PARTTRACKING.ABBR, ': ',
GROUP_CONCAT((CASE
WHEN PARTTRACKING.TYPEID = 20 THEN SUBSTRING(TIINVENTORYLOG.INFODATE FROM 1 FOR 11)
WHEN PARTTRACKING.TYPEID = 30 THEN SUBSTRING(TIINVENTORYLOG.INFODATE FROM 1 FOR 11)
WHEN PARTTRACKING.TYPEID = 40 THEN TIINVENTORYLOGSN.SERIALNUM
WHEN PARTTRACKING.TYPEID = 50 THEN CAST(TIINVENTORYLOG.INFODOUBLE AS DECIMAL(18,2))
WHEN PARTTRACKING.TYPEID = 60 THEN CAST(TIINVENTORYLOG.INFODOUBLE AS DECIMAL(18,5))
WHEN PARTTRACKING.TYPEID = 70 THEN TIINVENTORYLOG.INFOINTEGER
WHEN PARTTRACKING.TYPEID = 80 THEN TIINVENTORYLOG.INFOINTEGER
ELSE TIINVENTORYLOG.INFO
END ))) AS TRACKVALUE
FROM TIINVENTORYLOG
INNER JOIN PARTTRACKING ON (TIINVENTORYLOG.PARTTRACKINGID = PARTTRACKING.ID)
LEFT OUTER JOIN TIINVENTORYLOGSN ON (TIINVENTORYLOG.ID = TIINVENTORYLOGSN.TIINVENTORYLOGID)
GROUP BY TIINVENTORYLOG.INVENTORYLOGID, PARTTRACKING.ABBR, PARTTRACKING.SORTORDER
ORDER BY PARTTRACKING.SORTORDER) AS PARTRACKINFO
GROUP BY PARTRACKINFO.INVLOGID) TRACKINFO ON (INVENTORYLOG.ID = TRACKINFO.INVLOGID)
谢谢