List:General Discussion« Previous MessageNext Message »
From:Faisal Nasim Date:March 20 1999 6:12pm
Subject:MySql - feature missing?
View as plain text  
This is what a book says and MYSQL doesn't support it!


=-=-start

ANALYSIS:
The output confirms that the original data has not been changed and that the column
heading WHOLESALE+0.15 is not a permanent part of it. In fact, the column heading is so
unattractive that you should do something about it.

Type the following:

INPUT/OUTPUT:


SQL> SELECT ITEM, WHOLESALE, (WHOLESALE + 0.15) RETAIL
    FROM PRICE;

Here's the result:

ITEM           WHOLESALE  RETAIL
-------------- ---------  ------
TOMATOES             .34     .49
POTATOES             .51     .66
BANANAS              .67     .82
TURNIPS              .45     .60
CHEESE               .89    1.04
APPLES               .23     .38

6 rows selected.

ANALYSIS:
This is wonderful! Not only can you create new columns, but you can also rename them on
the fly. You can rename any of the columns using the syntax column_name alias (note the
space between column_name and alias).


blah.
blah.


--------------------------------------------------------------------------------
NOTE: Some implementations of SQL use the syntax <column name = alias>. The
preceding example would be written as follows:

SQL> SELECT ITEM = PRODUCE,
     WHOLESALE,
     WHOLESALE + 0.25 = RETAIL,
     FROM PRICE;
Check your implementation for the exact syntax. 


--------------------------------------------------------------------------------


-=-=-STOP


A bug? Shouldn't it be implemented? Both doesn't work on MYSQL.


Whats up?


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877


Thread
MySql - feature missing?Faisal Nasim20 Mar
  • Re: MySql - feature missing?Thimble Smith20 Mar