This is a multi-part message in MIME format.
----=_NextPart_ST_12_50_37_Friday_September_24_2004_6647
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
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 expr=
essed by the sender are not necessarily the views of SCRI and its subsidiar=
ies. 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. I=
t 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 co=
nfidentiality and you must not use, disclose, copy, print or rely on this e=
-mail in any way. Please notify mail [at] scri.sari.ac.uk quoting the name of th=
e sender and delete the email from your system.
Although SCRI has taken reasonable precautions to ensure no viruses are pre=
sent in this email, neither the Institute nor the sender accepts any respon=
sibility for any viruses, and it is your responsibility to scan the email a=
nd the attachments (if any).
----=_NextPart_ST_12_50_37_Friday_September_24_2004_6647
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml [at] 01C4A234.E2E4EFB0">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
span.EmailStyle17
{mso-style-type:personal-compose;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=3DEN-GB link=3Dblue vlink=3Dpurple style=3D'tab-interval:.5in'>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>Is there a way to select a column in a table by its posi=
tion
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.<o:p></o:p>=
</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>For example:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>CREATE TABLE Accessions (<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><span style=3D'mso-spacerun:yes'>
</span>accession_id INT8 PRIMARY KEY DEFAULT nextval('accession_id_seq'),<o=
:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><span style=3D'mso-spacerun:yes'>
</span>accenumb VARCHAR(255) NOT NULL,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><span style=3D'mso-spacerun:yes'>
</span>instcode_id INT4 NOT NULL CONSTRAINT Accessions_instcode_id_fk
REFERENCES Institutions(institution_id),<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><span style=3D'mso-spacerun:yes'>
</span>accename VARCHAR(255)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>I would like to select accession_id by indicating column=
1
somehow. Is this at all possible?<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>Cheers,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>Jennifer<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
<P align=3Dleft><FONT color=3D#0000ff><FONT face=3DTahoma color=3D#000000 s=
ize=3D2>**************************************************** ***************=
**********************</FONT></FONT></P>
<P align=3Dleft><FONT color=3D#0000ff><FONT face=3DTahoma color=3D#000000 s=
ize=3D2><STRONG>DISCLAIMER:</STRONG></FONT></FONT></P>
<P align=3Dleft><FONT color=3D#0000ff><FONT face=3DTahoma color=3D#000000 s=
ize=3D2>This email is from the Scottish Crop Research Institute, but the vi=
ews expressed by the sender are not necessarily the views of SCRI and its s=
ubsidiaries. This email and any files transmitted with it are confide=
ntial 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 add=
ressee.<BR>If you are not the intended recipient you are requested to prese=
rve this confidentiality and you must not use, disclose, copy, print or rel=
y on this e-mail in any way. Please notify <A href=3D"mailto:mail [at] scri.sari=
..ac.uk">mail [at] scri.sari.ac.uk</A> quoting the name of the sender and delete =
the email from your system.</FONT></FONT></P>
<P align=3Dleft><FONT color=3D#0000ff><FONT face=3DTahoma color=3D#000000 s=
ize=3D2>Although SCRI has taken reasonable precautions to ensure no viruses=
are present in this email, neither the Institute nor the sender accepts an=
y responsibility for any viruses, and it is your responsibility to scan the=
email and the attachments (if any).<BR></P></FONT></FONT></html>
----=_NextPart_ST_12_50_37_Friday_September_24_2004_6647--
