No. If you want to get the fields in a certain order from an SQL query,
you MUST do:
select fieldname, fieldname, fieldname from table
As long as you're doing:
select * from table
You're always going to get the fields in the order in which they exist in
the table.
Shawn
[EMAIL PROTECTED]
is.uci.edu To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
08/20/2002 03:16 bcc: Shawn Milochik/US/GODIVA/CSC
PM Subject: RE: SQL question
Yes I want to have the columns come out in a sorted order without
specifying them like "select col1, col2, col3 from database" because I
have too many columns (close to 80). Is there ways to select a table w/o
specifically telling the SQL server which ones I want?
Thanks!
Eric
On Tue, 20 Aug 2002, Bob Showalter wrote:
> > -----Original Message-----
> > From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 20, 2002 2:24 PM
> > To: 'learn perl'; [EMAIL PROTECTED]
> > Subject: RE: SQL question
> >
> >
> > > -----Original Message-----
> > > From: learn perl [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, August 20, 2002 1:38 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: SQL question
> > >
> > >
> > > Hi guys,
> > >
> > > just wondering how to sort the columns in order using SQL.
> > > Does anybody
> > > have any clue? for instance, my column headings are [1] [3]
> > > [2] [4] [2],
> > > is there a way to SELECT the table with the columns sorted in order?
> >
> > Look at your database's SQL documentation under "ORDER BY"
>
> Hmm, I read that question as "sort the rows". But if you mean "How do I
get
> the columns to come out in a certain order?", that is controlled by the
> order in which you list them in your select clause.
>
> SELECT * FROM table will give you the columns in the order defined in the
> database. If you want a different order, you need to explicitly list the
> columns:
>
> SELECT col1, col3, col2, col4 FROM table
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
**********************************************************************
This e-mail and any files transmitted with it may contain
confidential information and is intended solely for use by
the individual to whom it is addressed. If you received
this e-mail in error, please notify the sender, do not
disclose its contents to others and delete it from your
system.
**********************************************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]