0

我有一个查询,我需要在其中添加一个附加列。我有片刻灰质死亡,需要帮助。

按原样查询

SELECT g.groupId,g.name AS groupName,l.logId,l.name AS logName, i.itemID,
i.name AS itemName, le.userName,completed, i.optimalMin,i.optimalMax ,le.value,
u.name AS unitDescription,g.parentId
FROM logExceptions le
INNER JOIN logs l ON l.logID = le.logID
INNER JOIN groups g ON g.groupId = l.groupId
INNER JOIN items i ON le.itemId = i.itemId
INNER JOIN units u ON i.unitId = u.unitId

列名实际上是 l.name,但对于 parentId。附加的图像将显示我的意思。

4

1 回答 1

0

SOLUTION SELECT g.groupId,g.name AS groupName,l.logId,l.name AS logName, i.itemID, i.name AS itemName, le.userName,completed, i.optimalMin,i.optimalMax ,le.value, u.name AS unitDescription,g.parentId,g1.name AS parentName FROM logExceptions le INNER JOIN logs l ON l.logID = le.logID INNER JOIN groups g ON g.groupId = l.groupId INNER JOIN items i ON le.itemId = i.itemId left JOIN groups g1 ON g.parentId = g1.groupId INNER JOIN units u ON i.unitId = u.unitId

于 2013-11-20T04:44:28.403 回答