Skip site navigation (1) Skip section navigation (2)

select column by position

From: "Jennifer Lee" <jlee(at)scri(dot)sari(dot)ac(dot)uk>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: select column by position
Date: 2004-09-24 11:50:36
Message-ID: BE57D4C018CC2642AF256E2FDDA9095736953B@sims.scri.sari.ac.uk (view raw or flat)
Thread:
Lists: pgsql-sql
Is there a way to select a column in a table by its position rather than
the field name? If I understand correctly column position in a table is
fixed. I've not been able to find anything in the archives or docs to
indicate that it's possible to select by position.
 
For example:
 
CREATE TABLE Accessions (
    accession_id INT8 PRIMARY KEY DEFAULT nextval('accession_id_seq'),
    accenumb VARCHAR(255) NOT NULL,
    instcode_id INT4 NOT NULL CONSTRAINT Accessions_instcode_id_fk
REFERENCES Institutions(institution_id),
    accename VARCHAR(255)
);
 
I would like to select accession_id by indicating column 1 somehow. Is
this at all possible?
 
Cheers,
Jennifer
 

*****************************************************************
DISCLAIMER:

This email is from the Scottish Crop Research Institute, but the views expressed by the sender are not necessarily the views of SCRI and its subsidiaries.  This email and any files transmitted with it are confidential to the intended recipient at the e-mail address to which it has been addressed.  It may not be disclosed or used by any other than that addressee.
If you are not the intended recipient you are requested to preserve this confidentiality and you must not use, disclose, copy, print or rely on this e-mail in any way. Please notify mail(at)scri(dot)sari(dot)ac(dot)uk quoting the name of the sender and delete the email from your system.

Although SCRI has taken reasonable precautions to ensure no viruses are present in this email, neither the Institute nor the sender accepts any responsibility for any viruses, and it is your responsibility to scan the email and the attachments (if any).


Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2004-09-24 14:20:13
Subject: Re: need ``row number``
Previous:From: Karsten HilbertDate: 2004-09-24 07:21:17
Subject: Re: need ``row number``

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group