How to do in console

i wish to select id from table where name = ‘fahim’
Table name is Info and columns are id and name

how to write a query in console

If you are talking about the console of MySQL query then you can write

SELECT id FROM Info WHERE name = ‘fahim’

Else if you are talking about the ActiveRecord Query in rails then write
like this.“id”).where(:name => “fahim”)

This query would return you the ActiveRelation object containing the ids
from Info where name is fahim.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs