Hello Friends,

I have a rails application where requirement is that, I want to display
books based on likes and expiry date..

I am using the following query

"select books.*, (select count(*) from likes where likes.book_id = books.id)
as ct
from books, book_expires where book_expires.book_id = books.id order by ct
ASC, book_expires.end_at DESC"

And the output I am getting is on the bases of count not end_date..

Please let me know where I am getting wrong thanks...


Thanks
abhis

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 3, '12 at 7:44p
activeFeb 5, '12 at 3:47p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase