Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting entire row or column?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there a way to select an entire row or column? If i had this:

1 2 3 4 5
3 4 5 2 1
2 4 6 7 8
2 3 1 4 5

I want to select 1 2 3 4 5 and also 1 3 2 2....is there a universal way to do this because I wont be given the name of the row or column...
 

Rows don't have names. Choose an entire row with

Select * From Table Where <condition>

You should be able to programatically obtain the names of columns in a table and their ordinal position. Then you can select an &quot;entire column.&quot; How you determine the column names depends on your RDMS and the client you are using.

SQL Server example:

Select Column_Name, Ordinal_Position
From Information_Schema.Columns
Where Table_Name='tablename'
Order by Ordinal_position Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top