Shubham Agrawal Shubham Agrawal - 1 year ago 95
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

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download