标签: sql ruby-on-rails sql-server ruby-on-rails-4 activerecord
当我使用
Post.connection.execute "SELECT id FROM posts WHERE id in ('123')" # => 0
我得到结果0而不是像我期望的那样空记录集[]
0
[]
为什么会发生这种情况?
如果切换到
Post.find_by_sql "SELECT id FROM posts WHERE id in ('123')" # => []