------解决思路----------------------
select *,year(fbirthday) from t_PALM_Employees order by fsex compute max(year(fbirthday))
------解决思路----------------------
语法错误
compute ??? by 子句中 ???出的列必须出现在选择列表中
SELECT *,YEAR(fbirthday)
FROM TB
ORDER BY fsex
COMPUTE MAX(YEAR(fbirthday))
------解决思路----------------------
1.order by应该写在compute之后吧
2.还有你的compute字段后的函数产生的字段应该不在表中的字段中所以也会出错
USE AdventureWorks;
GO
SELECT CustomerID, OrderDate, SubTotal, TotalDue
FROM Sales.SalesOrderHeader
WHERE SalesPersonID = 35
ORDER BY OrderDate
COMPUTE SUM(SubTotal), SUM(TotalDue);