Select distinct FunctionType
From 
(select FunctionType
 from UF
Where OfficeCode='RW'
Order By FunctionCode);

解决方案 »

  1.   

    There is an incorrect ORDER BY item. The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants, SELECT list expressions, or expressions whose operands are constants or SELECT list expressions.
      

  2.   

    Select distinct FunctionCode, FunctionType
    From UF 
    Where OfficeCode='RW'
    Order By FunctionCode;
      

  3.   

    select FunctionType 
     from(
          select  distinct FunctionCode,FunctionType
            from  UF 
           where  OfficeCode='RW'
          )
    order by FunctionCode
      

  4.   

    谢谢大家。经测试,结果如下:
    glmcglmc(joe)方法:分析很对,但结果无改善.
    xbin999(xbin)方法;结果排序正确,但无需FunctionCode字段输出.
    xu_guanghui(小风)方法:结果正确!请接分。想不到子查询还可以这样使用^_^