korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

clojure korma.core order 问题 #392

Open 82089862 opened 6 years ago

82089862 commented 6 years ago

Doing project upgrades, Previous paragraph korma.core code

korma0.3.0 code : (last (select period (fields :qjnd :qjyf) (where {:dwdm dwdm :sfyjz 0}) (order :qjnd :desc :qjyf :desc)));

There is no problem in korma0.3.0,But there is a problem when calling koram0.4.3; Then order how to write koram0.4.3 when encountered multiple values; example

select qjnd ,qjyf from period where dwdm =dwdm and sfyjz=0 order by qjnd desc, qjyf desc;

Janderio commented 6 years ago
(last (select period
           (fields :qjnd :qjyf)
           (where {:dwdm dwdm :sfyjz 0})
           (order :qjnd :desc)
           (order :qjyf :desc)))

with sql only -> ... ORDER BY period.qjnd DESC, period.qjyf DESC

82089862 commented 6 years ago

Thank you, it has been resolved