MySQL Forums
Forum List  »  Perl

Query for unkown column name
Posted by: Rene Jaspers
Date: June 19, 2012 06:12AM

Oke here it goes,
i have 2 tables (exchangerate and player)
player has a column called currency
and exchangerate has columns named after those currencies
So what i would like to do is this

select
player.name,
player.currency, (like eur of usd)
exchangerate.[player.currency] as exchangerate
from
player
inner join exchangerate on ( exchangerate.date = DATE(NOW()) )
where
player.id = 1;

Giving me the following row
[name] [currency] [exchangerate]
John 'usd' 1.2345

Any help is nice!

Options: ReplyQuote


Subject
Written By
Posted
Query for unkown column name
June 19, 2012 06:12AM


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.