Wednesday, March 29, 2017

Quering the best result in terms of sum of column's rows in Eloquent ORM laravel?

I have a table like this enter image description here now first i am quering the results in term of same temperatur and zeit e.g.

(select * from table where temperatur= array..  AND zeit=array...). 

Now for exampe i got a result something like this..

enter image description here

one with temperatur and zeit= 85,30 and other one with 85,45.. now according to the sum of columns of (aussehen,farbe,deformation,geruch,texture) i want to get the best result. e.g the final sum of rows of matching columns is( 14) and the other match is (17) i want to get the best result which is 14.. how can i do that in laravel orm?



via Hassan Haroon

Advertisement