sql - ruby on rails equivalent statement of find_by_sql -
What will happen when given the following given below?
@mostviews = post .find_by_sql ("select posts.id, from posts.title posts countpages.post_id = count.pages.counts desc range 5 on orders.id command" 5) @temp = Post.find_by_sql ("Selection post_id, COUNT (*) counts posts as a post_id by the group by AS count, posts = posts.find_by_sql (" select posts .post, posts title, comment_count.count inner joiner posts) comment_count.post_id = posts.id Comment on "Count 5" from the limit of DESC as count; ") Is it possible that you find or use the function?
post. Selection ("Post id, posts.title"). Join ((countpage) .order ("countpages.counts desc"). Limit (5) This count is a union Otherwise, you may be more explicit in joining ("INNER JOIN ... ")
Comments
Post a Comment