FaaPz/PDO

how to set columns only max(field) without *

Closed this issue · 2 comments

i only want to search 'max(filed) as max' without any other fields
but the select() method set columns as * default
is this $pdo->select(array('max(field) as max')) the only way?

kwhat commented

Hi Tonvin,

Are you using version 1 or version 2 of the library.

kwhat commented

If you are using version 2, you can do $pdo->select(array('max' => new Method('MAX', 'field')))