I do not think you can directly do that in any valid SQL query and
actually get a valid response — because column-indexes can easily change due to the way that a table is defined — without applying a hack around it. Also, it doesn't make any sense, why not the
column_name
?
For the
SELECT
statement, you need to either pass the column names or the wildcard. Once the data has been returned, you can read the column by index. That can be done through any SQL reader, such as C# objects for the SQL Server or other similar for MySQL.
But before that, I don't think that is possible. Only a few of the areas permit you to use an ordinal value or the column;
ORDER BY
clause etc.
There is a similar question on CodeProject you might want to try that,
[Solved] SELECT columns by column-index NOT by columnname![
^]