我创建了一个使用mssql计算问题集的过程。我在下面发布该查询。现在我想将以下查询转换为mysql,但它返回错误。请帮我修复此错误..
我的部分查询就在这里......
select trainPrecent1 = (select distinct(fldprecentage) from precentage where fldgroup='Training' and fldset='First'),
trainPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Training' and fldset='Second'),
agentPrecent1 = (select distinct(fldprecentage) from precentage where fldgroup='Agent on floor' and fldset='First'),
agentPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Agent on floor' and fldset='Second'),
superPrecent1 = (select distinct(fldprecentage) from precentage where fldgroup='Supervisor on floor' and fldset='First'),
superPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Supervisor on floor' and fldset='Second')
现在收到以下错误...
"unknown column name "trainPrecent1" in fielelist...
请帮我解决此错误....
答案 0 :(得分:4)
使用 AS 代替 = 进行尝试:
select (select distinct(fldprecentage) from precentage where
fldgroup='Training' and fldset='First') AS trainPrecent1,
......