ryel01 Posted January 28, 2011 Share Posted January 28, 2011 Hello! Does anyone know if it's possible to perform a left join onto a column name? ie. in the following sql I want paymentmethods.method to be used to match the "paymentsettings.column_name", instead of actually specifying "paymentsettings.column_name" directly. So for an example of what I mean that doesn't work... and paymentmethods.method = paymentsettings.(paymentmethods.method) left outer join paymentsettings on account.id = paymentsettings.aid and paymentmethods.method = paymentsettings.column_name ? Regan Quote Link to comment Share on other sites More sharing options...
fenway Posted February 11, 2011 Share Posted February 11, 2011 I don't follow. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 11, 2011 Share Posted February 11, 2011 I understand, but I do not think it's possible. Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 11, 2011 Share Posted February 11, 2011 You might try explaining better what you're trying to do. In general, no, joins are based on values matching in particular columns. There is no way for mysql to guess what column you want to join on or alter that on a row by row basis. A lot of times when someone is looking for something like that it reflects that their database structure is not relational. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.