1
我有愚蠢的問題執行查詢。由於我在goals_num變量中存儲整數,因此我打算將它用於另一個查詢,但它不會運行任何操作。然而,如果不是goals_num我插入221(這是它包含的內容)查詢運行我得到結果打印。任何人都可以告訴我有什麼問題嗎?謝謝!sqlite3和紅寶石查詢執行
puts goals_num = db.execute("select MAX(goals) from EnglandTopScorers")
db.execute("select * from EnglandTopScorers where goals='#{goals_num}' ") do |row|
puts row
end