Reply
MQSL Query Question -- column names from another table
Old 07-19-2009, 04:15 PM MQSL Query Question -- column names from another table
Average Talker

Posts: 24
Name: Jeremy
Trades: -1
Mysql query question: I want to run a join query that selects columns from table A based on values in table B. Namely table B contains the column names for table A.
EX: Select table_B.col_table_A from table_A JOIN table_B on table_A.key = table_B.a_key
The columns names selected are from table A are stored in tale B.
thanks in advance

I'm basically looking for a way for mysql to treat the value as a column name and not a value

Last edited by limitedgoods; 07-19-2009 at 04:24 PM..
limitedgoods is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-19-2009, 05:28 PM Re: MQSL Query Question -- column names from another table
wayfarer07's Avatar
NYE-KEE

Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
"select *.t1, a_key.t2 from table1 t1, table2 t2 where t1.a_key=t2.a_key";
__________________
Wayfarer | jQuery Tooltip Plugin | Mapbox: the jQuery Map
Freelance Jobs Available
If Google is the Coca-Cola of Web search, Bing is RC Cola
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to MQSL Query Question -- column names from another table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11161 seconds with 13 queries