How do I select column(s) by their "numeric" position in a table?
- by DulcimerDude
I am trying to select columns by their "x" position in the table.
DBI
my $example = $hookup->prepare(qq{SELECT This,That,Condition,"I also want COLUMN-10" FROM tbl LIMIT ? ?});
###column_number=10 ordinal_position??
$example->execute('2','10') or die "Did not execute";
Is this possible or do I need to run another single select to just that column?
One problem I encountered was with a col named "Condition". For some reason, when I tried to select Condition the execute would die. I never attempted but, What if the column name was SELECT?
Another note is the table is 75 cols wide and I only need 50 of them. The Col names are pretty verbose so, I would like to just call them by their "position". This would also allow the col names to be changed in the future without having to change the select statement.
I am quite the newbie so please explain any answers down to my level. Thanks for any assistance..