Guest User

Untitled

a guest
Apr 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Question.find_by_sql("SELECT AVG(value) FROM (
  2. SELECT value FROM answers WHERE question_id=1 ORDER BY value LIMIT (
  3. SELECT COUNT(*)/4 FROM answers WHERE question_id=1
  4. ), (SELECT 2*(COUNT(*)/4) FROM answers WHERE question_id=1)
  5. ) as T;")
Add Comment
Please, Sign In to add comment