Re: subquery, alias and derived tables
On 3 Oct, 13:18, hans christian <christ...@notmail.com> wrote:
> Hello, I am trying to come up with a way to preform the same query over a
> list of tables; of which the tablenames are stored in a ... table.
>
> I have tried numerous ways but unfortunatly the column name is not
> expanded or treated as the tablename in the outerquery. So I am trying
> now with a subquery only to get caught in the alias mixer. For example:
>
> mysql> SELECT open,high,low,close FROM (SELECT tablename FROM properties);
> ERROR 1248 (42000): Every derived table must have its own alias
>
> Is there a way to receive the list of tablenames and preform a subquery
> within the same select statement ?
>
> If so I am going to keep searching for the answer using subquery
> otherwise I will have to come up with something else.
>
> Thank you for any suggestions.
>
> Cheers,
>
> Hans.
I think you need a stored procedure
|