"Marco Bresciani" <[EMAIL PROTECTED]> wrote:
> Hello all,
>  I have a little problem to solve.
> I have a "List" table that lists the tables contained in the same DB. This
> table has a "Name" filed that contains such names.
> 
> My problem is that the list.name filed doesn't contain the complete name of
> the tables but it misses a "prestring". Say: a table is named "FXnnnn" but
> the list.name field contains "nnnn" only.
> 
> I have to create a query like:
> 
> SELECT * FROM [every table in list.name] WHERE [condition]
> 
> but I cannot use "SELECT Name FROM List" to gain the names of the tables
> because they all miss the "FX" string.
> 
> How can I create this kind of query? Something like:
> 
> SELECT * FROM ("FX" + SELECT Name FROM List) WHERE [condition]
> 

You can't do it only with MySQL. Retrieve table names from List table:
        SELECT CONCAT("FX", Name) FROM List;

and then use programming language to construct a query.



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to