Afficher un message
Vieux 12/10/2007, 10h55   #7
bamroberts@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: subquery, alias and derived tables

On Oct 3, 1:18 pm, 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.


Hi Hans

Try this: "SELECT open,high,low,close FROM (SELECT tablename FROM
properties) as my_table; "

  Réponse avec citation
 
Page generated in 0,06753 seconds with 9 queries