Hi,
I have list of columns as an array, for example:
columns = [ :level1, :level2, :level3]
I would like to select only those columns. How can I do that?
Following code does not seem to work as expected:
result = dataset.select(columns)
this wraps column names in parenthesis:
SELECT (level1, level2, level3) FROM ...
which results in SQL syntax error.
Thanks,
Stefan
p.s.: Side-question: is this a bug or a feature, that selection using
Hash has keys as "what is going to be selected" and values as column
names? I would expect logically something like this:
selection = Hash.new
selection[:column_name] = "expression"
dataset.select(selection)
instead of current implementation:
selection = Hash.new
selection["expression"] = :column_name
dataset.select(selection)
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.