MySQL Forums
Forum List  »  Newbie

Newbie query question
Posted by: wizzy_us
Date: August 23, 2005 11:50AM

Hello,

I am new to using MySQL and databases, and I was wondering if the following was possible

say I have a TABLE EXP, which has column name X , and another column Y.

which has data like
EXP
col X Y
val 1 test

Now when I query this table I want the data from coumn X but I want the column name to be Y .

To make it clearer

for example
SELECT X FROM EXP; will give me the values in COLUMN X

Like col name - X
values - 1


SELECT X AS "TEST" FROM EXP; This will give me values as
col name - TEST
values - 1

Now I want the column name to be a value for column Y
something like

col name - Y
value - 1

Is this possible ?

Options: ReplyQuote


Subject
Written By
Posted
Newbie query question
August 23, 2005 11:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.