FaaPz / PDO

Just another PDO database library
MIT License
316 stars 103 forks source link

how to set columns only max(field) without * #102

Closed hawktian closed 5 years ago

hawktian commented 6 years ago

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 5 years ago

Hi Tonvin,

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

kwhat commented 5 years ago

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