paypal plugin

This blog are helpful for you???? So please Donate! :)





sexta-feira, 27 de dezembro de 2013

complexity dal select max min datetime

in the following example, i got a field type datetime, and get the max time from each day.


 rows = db(db.filesys_consume.id_systems==db.systems.id).select(db.account.name,db.systems.hostname,  
                                   db.filesys_consume.disk_fsys,  
                                   'DATE(filesys_consume.date_run) as run_date',  
                                   'MAX(TIME(filesys_consume.date_run)) AS run_time',  
                                   db.filesys_consume.free_k,  
                                   db.filesys_consume.total_k,db.filesys_consume.percent_usage,  
                                   left=left,  
                                   groupby=[db.account.name,db.systems.hostname,db.filesys_consume.disk_fsys,'run_date'],  
                                   orderby='account.name,systems.hostname,filesys_consume.disk_fsys,run_date desc')  

the expected output.



cheers!

Nenhum comentário:

Postar um comentário