If you are talking about the console of MySQL query then you can write as
below.
SELECT id FROM Info WHERE name = ''fahim''
Else if you are talking about the ActiveRecord Query in rails then write it
like this.
Info.select("id").where(:name => "fahim")
This query would return you the ActiveRelation object containing the ids
from Info where name is fahim.
On Wednesday, September 12, 2012 4:56:22 PM UTC+5, Fahim Patel
wrote:>
>
>
> 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
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/RamqbD8PTFAJ.
For more options, visit https://groups.google.com/groups/opt_out.