postgres データベースから行を取り出そうとしていますが、それらを desc から取り出せますが、ランダムにしようとするとランダムに近い構文エラーが発生します。
エラー
PG::Error: ERROR: syntax error at or near "rand"
LINE 1: ... "hashtags".* FROM "hashtags" ORDER BY tweet_id rand LIMIT...
^
: SELECT "hashtags".* FROM "hashtags" ORDER BY tweet_id rand LIMIT 4
引き出すコード
<div id="hashtags">
<% Hashtag.order("tweet_id desc").limit(4).each do |hashtag| %>
<blockquote><%= hashtag.content %></blockquote>
<div class="from">— @<%= hashtag.screen_name %></div>
<% end %>
</div>