SQL to return first two columns of a table

前端 未结 8 587
猫巷女王i
猫巷女王i 2020-12-10 05:04

Is there any SQL lingo to return JUST the first two columns of a table WITHOUT knowing the field names?

S

8条回答
  •  死守一世寂寞
    2020-12-10 05:54

    If you want a permant object that you can query over and over again make a view for each table that only returns the first 2 columns. You can name the columns Column1 and Column2 or use the existing names.

    If you want to return the first two columns from any table without any preprocessing steps create a stored procedure that queries the system information and executes a dynamic query that return the first two columns from the table.

提交回复
热议问题