Is it possible to select fields in a table by position?

Let's say I have a table "foobar" like so:

foo   bar   bat
a     1     x
b     2     y
c     3     z

I can select the bar field with SQL like so:

   select bar from foobar;

Since bar is the second field in the table, I was wondering if I can  
select fields using the numerical position:

   select 2 from foobar;

Unfortunately, that simply returns the value of "2" for every  
record.  A search through my Oracle, PostgreSQL, and MySQL books did  
not mention that this can be done, but maybe it can and I'm just  
overlooking something.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent


 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to