On Sep 3, 2010, at 10:11 AM, Eric wrote:

> hello,guys,i have a problem when i use elixir
> previous=Article.query.filter(Article.id < 20).first()
> i want query out the max id less than 20 in  my db?
> is my statement correct or other better way archive this

The least thing that needs adding is an order_by(Article.id.desc()).

And it sounds odd to me to look for something like that, I smell a 
design-smell...

Diez

-- 
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en.

Reply via email to