raw sql query for Editor
raw sql query for Editor
zapata
Posts: 13Questions: 5Answers: 1
I often have to write complex SQL query for detailed reports. Below codes are not suitable and not easy for Editor. Does Editor present us RAW query method to get Datatables JSON?
SELECT table1.username AS username, table3.verici as v,table4.srvname as sn,table2.srvid as srvid,
( sum(table1.acctsessiontime) / 3600 ) as sestime, ( sum(table1.acctinputoctets) / 8589934592 ) as upload,
( sum(table1.acctoutputoctets) / 8589934592 ) as download
FROM table1,table2
left join table3 on table3.id=table2.ap
left join table4 on table4.srvid=table2.srvid
where (table1.username=table2.username and table2.servicetype='wireless' AND
_accttime BETWEEN '2015-12-08' AND '2015-12-09') OR (table1.username like '%ms.%' AND table1.username like '%mrs.%')
group by table1.username
This discussion has been closed.
Answers
no way! no one of them doesnt work!
GOD THANKS. I solved it. We dont need EDITOR namespace if we use raw sql!
Hi,
This is correct. There is a
DataTable->sql()
method that can be used to execute raw queries using the Database libraries that Editor comes with. Raw queries can't be used for editable tables directly, but they do allow flexibility if you want to create you own queries without your own database connection object.Allan