在公司修改bug,有这样的需求:需要从两张视图中查出相同字段的数据,按照导师姓名先排序,再按照学号排序 union联合两张表,SELECT * from((SELECT DS_ID,PYLX_ID,YX_ID,DS_XM,XH,XM FROM PY_VIEW_YJSXX WHERE ID IN ('720c8511d1994434a55dae6f545652bc') )UNION ALL(SELECT DS_ID,PYLX_ID,YX_ID,DS_XM,XH,XM FROM PY_VIEW_ZJ…