I know how to query a column using select
operation when I know the column's name, like select name from User
, but how can I get the first column or the 2nd column or any specific column in table by using their ordinal position?
Asked
Active
Viewed 881 times
0

ktdrv
- 3,602
- 3
- 30
- 45

HaiFengZeng
- 103
- 10
-
select `here what columns you want separated by comma` from table – JYoThI Jul 06 '17 at 05:17
-
2Maybe you can find your answer here: [https://stackoverflow.com/questions/4924365/sql-to-return-first-two-columns-of-a-table](https://stackoverflow.com/questions/4924365/sql-to-return-first-two-columns-of-a-table) – Thomas Jul 06 '17 at 05:19
-
you can find it here https://stackoverflow.com/questions/1054984/how-can-i-get-column-names-from-a-table-in-sql-server – Jatin Parmar Jul 06 '17 at 05:28
-
[Select column by ordinal position](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8c9a250b-05b3-49b8-b6f1-800230762688/select-column-by-ordinal-position?forum=transactsql) . – mmushtaq Jul 06 '17 at 05:30