Method: Sequel::Dataset#with_sql_single_value

Defined in:
lib/sequel/dataset/actions.rb

#with_sql_single_value(sql) ⇒ Object

Run the given SQL and return the first value in the first row, or nil if no rows were returned. For this to make sense, the SQL given should select only a single value. See with_sql_each.



1110
1111
1112
1113
1114
# File 'lib/sequel/dataset/actions.rb', line 1110

def with_sql_single_value(sql)
  if r = with_sql_first(sql)
    r.each{|_, v| return v}
  end
end