Hello! Many thanks to everybody who tried to help me!
> N.B. you should have only one pnid to make your query work (UNIQUE pnid), > or LIMIT the result of the subquery by LIMIT 1. I need to do the following: Get one or more than one "pnid" from vt_partition and then make queries to the "vt_pnid" tables. The result (from all the requested "vt_pnid" tables) should be sorted by date and time. How to do it? The version of MySQL should be 4.1.11 or lower. It would be great if the query works even on v. 3.23.58. > First off, you are not writing a subquery. You are attempting to build a > SQL query using the results of another query. What you are attempting is > dynamic SQL. I am not familiar with a mechanism in 4.1.11 that allow you > to execute a string (or a string variable) from within a SQL statement. > Damn! You're right!! I only looked at the subquery itself, not the context > and I missed that his "subquery" seems to an expression to get part of his > table name! That is definitely not valid in any dialect of SQL that I know > ;-) Agree, I was wrong. :-) -- Good luck! Vladimir Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]