How to select a column without its name in sql server? -
how
select name,family student name="x" without column name.
for example :
select "column1","column2" student "column1"="x" or example
select "1","2" student "1"="x" "1" column1 "2" column2
i dont want columns name. want number or other.... idont tired select *. dont know columns name know are. columns name change every want read file data same, , data in same columns in each file.
although can not use field positions specifiers in select statement, sql standard includes information_schema dictionary of tables defined. includes columns view fields of tables defined. , in view, there field called ordinal_position can use assist in problem.
if query
select ordinal_position, column_name information_schema.columns table_name = 'table' order ordinal_position then can obtain column names ordinal positions want. there can prepare sql statement.
Comments
Post a Comment