column number instead of column name

From: First Last <y2kdis(at)atenista(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: column number instead of column name
Date: 2006-01-20 08:24:37
Message-ID: 20060120002437.E662DAB0@dm20.mta.everyone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


how can i make use of the column number instead of the column name when making the select statement?

for instance:
"SELECT mytable.col[1], mytable.col[2], mytable.col[3], mytable.userid from mytable"

i have several tables and i need to extract the first three columns and a known column. the first three columns for the different tables vary, but all the tables have the userid column.

_____________________________________________________________
Check out Atenista.Net (www.atenista.net)- new design, regular content and additional services!

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-01-21 05:22:46 Re: column number instead of column name
Previous Message Lynna Landstreet 2006-01-20 07:36:27 Re: Problems with select statement