I have this query :
$b = Class::orderBy('created_at', 'desc')->take(50)->get();
This gets me the last 50 elements in my table . However i only want every 3 rows e.g : valu1 , value3 , value5 , value6
Is there a way to process that directly in the sql query without additional code ?
Thanks
- Does not have to be eloquent , could be an sql query that does the same as above.
Thanks