MySQL Forums
Forum List  »  Docs

is there a way to evaluate query results back into the query string?
Posted by: edward anastas
Date: September 08, 2004 12:51PM

I am trying to find a way to use the results of a mysql query as a part of the table name of a left join in that same query? here is an example...

SELECT *
FROM payments
LEFT JOIN CONCAT( 'payments_', payments.payment_type ) USING ( payment_id )
WHERE payments.payment_id = '3'
LIMIT 1

At the moment I do not think there is a way of doing this? I found a post that was similar my problem --> http://lists.evolt.org/archive/Week-of-Mon-20040524/159450.html

If this functionality is not implemented, there have been mulitple times when I could have used it.

I would appreciate any suggestions if someone happens to know how to do this otherwise please add the functionality to mysql, thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
is there a way to evaluate query results back into the query string?
7369
September 08, 2004 12:51PM


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.