On Tue, Feb 13, 2007 at 04:23:27PM -0600, Jim Steil wrote:
> Is there an easy way to return a row with a maximum column value in it?

> class Process(SQLObject):
>     class sqlmeta:
>         style = Style(longID=True)
>         idName = 'processId'
> 
>     name = UnicodeCol(length=50)
>     processKey = UnicodeCol(length=4)
>     description = UnicodeCol()
>     startAt = TimeCol()
>     intervalMinutes = IntCol()
>     gracePeriodMinutes = IntCol()
>     createdOn = DateCol(default=datetime.now())

print Process.select(Process.q.startAt > time(12, 
0)).max(Process.q.intervalMinutes)

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to