I've this GIGANTIC view with several hundred columns and I need to select 114th column something like:
SELECT "144" FROM MyView;
PS: Obviously, I don't know the name of the column. I just copied the results row into an Excel file, searched for a particular value that is in EJ column so I want to select all rows showing only nth column in my view to do my further debugging.
Cheers!
ROW_NUMBER (Window Function) ROW_NUMBER (Window Function) is a standard way of selecting the nth row of a table. It is supported by all the major databases like MySQL, SQL Server, Oracle, PostgreSQL, SQLite, etc.
Click the top edge of the column header or the column in the table. The following selection arrow appears to indicate that clicking selects the column.
To select columns, choose one of the following options: Type SELECT , followed by the names of the columns in the order that you want them to appear on the report. Use commas to separate the column names.
If you are using MS SQL Server you can
sp_help ViewName
and then scroll to the 144th column in the Column_name result set to see what the name of that column is.
Additionally you can choose "Copy with Headers" in the result pane in SQL Server Management Studio and paste the result set into Excel with the headers (column names) intact.
I'd suggest giving all the columns names based upon their Excel column name. There should be an excel solution to make the first row equal to the column name (ie AA, BB, etc). Then do your import, then select based upon the column name which should be computable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With