I don't Mysql very well, but I would be very surprised if that was
supported, based on my experience with Oracle. You need to distinguish
between data and database object names. You can use derived_tables to return
data, but niot names.

You can't do " select * from 'table'", because 'table' is a string, not an
object name, your subquery is returning 'table'.

You need to use dynamic sql for that sort of thing.

> -----Original Message-----
> From: Shawn McGinn [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2003 18:02
> To: [EMAIL PROTECTED]
> Subject: derived tables
>
>
> I would like to select data from a table where the table name
> is located
> in another table, and I am using the following query:
>
> select t1.* from (select tbl_name from user_table where
> user="guy") t1;
>
> This should return the data from table 'tbl_name', but I only get
> results from the subquery (ie. the query as a whole returns
> 'tbl_name',
> not it's contents)  Where am I going wrong?
>
> I am using version 4.1.0-alpha-standard.
>
> Shawn
>
>
> --
> Shawn McGinn <[EMAIL PROTECTED]>
> UNB
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>


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

Reply via email to