Lucid: How to add properties like MAX() or MIN() to a query

Created on 31 May 2017  路  2Comments  路  Source: adonisjs/lucid

Hi,

I have a query like this:

    const max = yield Database
        .table('contacts')
        .select('updated_at')

How can I add a method, that only the most recent updated_at column is displayed?

Thank you!

Most helpful comment

Try

const max = yield Database
.table('contacts')
.max('updated_at')

From the knex docs

All 2 comments

Try

const max = yield Database
.table('contacts')
.max('updated_at')

From the knex docs

Closing since not actionable

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nwashangai picture nwashangai  路  5Comments

alexhenriquepv picture alexhenriquepv  路  3Comments

babadee08 picture babadee08  路  6Comments

vrwebdesign picture vrwebdesign  路  3Comments

mtnptrsn picture mtnptrsn  路  5Comments