select * from safe_xiajingzongbiao inner join safe_Department on safe_xiajingzongbiao.kuangbie=safe_Department.DepartmentName where month(shijian)=month(@shijian) and year(shijian)=year(@shijian) order by safe_Department.ID , safe_xiajingzongbiao.shijian desc
转载于:https://www.cnblogs.com/windphoenix/archive/2009/07/08/1519023.html