#1 2018-09-12 09:10:28

cybexr
Member
Registered: 2016-09-14
Posts: 81

TSynTableStatement support order by multipy fields with desc/asc.

Original TSynTableStatement has a property: OrderByDesc:Boolean, it will remember whether last word=desc.

But think if a SQL like this: select name,price,year from cata where 1=1 order by price desc, year, name .  Then TSynTableStatement will work incorrectly, it will ignore , year,name . So I have made some changes , add a property:  OrderByDescField:TSQLFieldIndexDynArray, it will remember every SQL-Field marked with "DESC" .

Test passed with TestSQL3 on FPC&Delphi7 on windows.

I have created a P/R on github,  https://github.com/synopse/mORMot/pull/123, Please review it, thanks ab.

Offline

Board footer

Powered by FluxBB