我正在编写 sql 查询,我想在 datagrid 视图中使用同一列两次。
这是我的查询:
SELECT ElectricityMachinePanelDetails.MachineDescription AS "Machine Name",
ReadingValue AS "Last Day Meter Reading"
FROM ElectricityDailyMeterReadingDetails
INNER JOIN ElectricityMachinePanelDetails ON ElectricityMachinePanelDetails.MachinePanelID = ElectricityDailyMeterReadingDetails.MachinePanelID
INNER JOIN ReadingTypesDetails ON ElectricityDailyMeterReadingDetails.ReadingTypeID = ReadingTypesDetails.ReadingTypeID
WHERE ReadingCategoryID = 'RC001' AND
ReadingTypesDetails.ReadingTypeID = 'RT001'
如何ReadingValue
在数据网格中使用两次列名。