-10

SQL:

Select ROW_NUMBER() OVER(Password) From Student
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

1

Most, but not all (I think Oracle is one which doesn't) database systems implemented the INFORMATION_SCHEMA which you can query to get information about database objects. In order to get the ordinal position of a column in a table, you can use:

SELECT      C.ORDINAL_POSITION
FROM        INFORMATION_SCHEMA.COLUMNS AS C
WHERE       C.TABLE_NAME = 'Table'
        AND C.COLUMN_NAME = 'Password'

I can't help wonder why you need this information though...

HoneyBadger
  • 14,750
  • 3
  • 34
  • 48