How to write GROUP BY SQL query in ruby? -
help me in writing group_by condition in ruby. have migrate php-project ruby now, , faced problem. not judge strictly, i'm new in ruby.
this query in php:
$get_details_email = db_query("select secret_key,trustee_status,email_id trustees request_by='email' , user_id='$user_id' group email_id");
how group query below on email_id?
get_details_email = trustee.select(:secret_key, :trustee_status, :email_id).where(:request_by => 'email', :user_id => user_id)
get_details_email = trustee.select(:secret_key, :trustee_status, :email_id).where(:request_by => 'email', :user_id => user_id).group(:email_id)
Comments
Post a Comment