F
fyqa11
Unregistered / Unconfirmed
GUEST, unregistred user!
with dm.ADOQuery1 do
begin
close;
sql.Clear;
sql.add('select 姓名,sum(加分分值) as 加分分值,sum(扣分分值) as 扣分分值,(sum(加分分值)-sum(扣分分值)) as 合计分值 from khjl');
sql.add('where 考核日期>=:rq1 and 考核日期<=:rq2 group by 姓名 order by desc');
Parameters.ParamByName('rq1').value:=formatdatetime('yyyy-mm-dd',datetimepicker1.Date);
Parameters.ParamByName('rq2').value:=formatdatetime('yyyy-mm-dd',datetimepicker2.Date);
open;
end;
我想按合计分值来排序,即分高的显示在前,分低的显示在后,请问order by后面如何写?
begin
close;
sql.Clear;
sql.add('select 姓名,sum(加分分值) as 加分分值,sum(扣分分值) as 扣分分值,(sum(加分分值)-sum(扣分分值)) as 合计分值 from khjl');
sql.add('where 考核日期>=:rq1 and 考核日期<=:rq2 group by 姓名 order by desc');
Parameters.ParamByName('rq1').value:=formatdatetime('yyyy-mm-dd',datetimepicker1.Date);
Parameters.ParamByName('rq2').value:=formatdatetime('yyyy-mm-dd',datetimepicker2.Date);
open;
end;
我想按合计分值来排序,即分高的显示在前,分低的显示在后,请问order by后面如何写?