How do I select column(s) by their “numeric” position in a table?

前端 未结 3 1597
伪装坚强ぢ
伪装坚强ぢ 2021-01-15 13:55

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         


        
3条回答
  •  忘掉有多难
    2021-01-15 14:48

    You could read COLUMNS.ORDINAL_POSITION (see here), but this sounds like a disaster waiting to happen.

    You can (and always should!) quote column names in ``, e.g. SELECT `colname`. This will handle cases of table names being Condition or SELECT.

提交回复
热议问题