Shubham Agrawal Shubham Agrawal - 1 year ago 63
SQL Question

Order BY diffrence of two columns using DataMapper

I have a mysql table.

It contains 2 Column (startdate,enddate)

Both are of DateTime type
Using sql

select * from ABC order by (enddate-startdate) DESC;

same thing i want in datamapper...but i m not able to do it
Plz help


Thanks, i got one datamapper function to run sql query directly

repository(:default)'select * from ABC order by (enddate-startdate) DESC')