在工会之后需要帮助订购
select sno,measurement from measurementTable union all select '' as sno,avg(measurement) as
measurement from measurementTable union all select '' as sno,
max(measurement)-min(measurement) from measurementTable;
我需要在datagrid的底部显示平均值,但是命令所有其他mssql服务器表行按sno升序 我试图在联合之前使用order by并且出错
select sno,measurement from measurementTable order by sno asc union all select '' as sno,
avg(measurement) as measurement from measurementTable union all select '' as sno,
max(measurement)-min(measurement) from measurementTable;
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'union'.
是否可以在联合之前使用order by?