SET @query = 'select SUBQUERY.ABC,SUBQUERY.DEF from (SELECT abc as \'ABC\' ,def as \'DEF\',ghi as \'GHI\' from table) as subquery group by ABC order by DEF';
我想使用存储过程从子查询中选择特定列。但是,当我尝试这个时,我将获得异常作为“未知列”SUBQUERY.ABC“在字段列表中”。我也尝试了这个
select ABC,DEF from (SELECT abc as \'ABC\' ,def as \'DEF\',ghi as \'GHI\' from table) as subquery group by ABC order by DEF';