class SQLite3::Database

def get_first_value( sql, *bind_vars )

See also #get_first_row.

identical to #execute.
result set, and discarding all other values and rows. It is otherwise
A convenience method for obtaining the first value of the first row of a
def get_first_value( sql, *bind_vars )
  query( sql, bind_vars ) do |rs|
    if (row = rs.next)
      return @results_as_hash ? row[rs.columns[0]] : row[0]
    end
  end
  nil
end