EthylAcetate PrintCylinder HDpolythene
12 8 5
9 2 9
我想分别在每列中添加值,并根据总数按照降序排列datagrid
中的列..上面我提到了我使用的代码。
它确实给了我每行的总和,但它并没有给我排序的列。
cmd.CommandText = "SELECT sum(eAce) as SumEacetate , sum(pCl) as PrintCylinder , sum(hdp) as HDpolythene FROM TblSalesOrder ORDER BY SumEacetate, PrintCylinder , HDpolythene DESC ;"
答案 0 :(得分:0)
您必须为每列编写DESC
个关键字
cmd.CommandText = "SELECT sum(eAce) as SumEacetate , sum(pCl) as PrintCylinder , sum(hdp) as HDpolythene FROM TblSalesOrder ORDER BY SumEacetate DESC, PrintCylinder DESC, HDpolythene DESC ;"