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
You could read COLUMNS.ORDINAL_POSITION (see here), but this sounds like a disaster waiting to happen.
COLUMNS.ORDINAL_POSITION
You can (and always should!) quote column names in ``, e.g. SELECT `colname`. This will handle cases of table names being Condition or SELECT.
SELECT `colname`
Condition
SELECT