How to select a MAX value from column in Query Builder in Kohana framework?
- by Victor Czechov
I need to INSERT a data to table, but before a query I must to know the MAX value from column position, than to INSERT a data WHERE my SELECTED before position+1. Is it possible with query builder?
following my first comment I did query:
$p = DB::select(array(DB::expr('MAX(`position`)', 'p')))->from('supercategories')->execute();
echo $p;…