MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From: Date:January 1 1970 12:00am
Subject:Re: How to write subqueries?
Date: Tue, 14 Jun 2005 23:29:46 +0400
View as plain text  
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
Thread
How to write subqueries?Unknown Sender14 Jun
  • Re: How to write subqueries?SGreen14 Jun
    • RE: How to write subqueries?Rhino14 Jun
  • RE: How to write subqueries?Rhino14 Jun
  • Re: How to write subqueries?mfatene14 Jun
    • Re: How to write subqueries?Unknown Sender14 Jun
      • Re: How to write subqueries?mfatene14 Jun
        • Table fullEmmett Bishop15 Jun
          • Re: Table fullmfatene15 Jun
            • Re: Table fullEmmett Bishop15 Jun
              • Re: Table fullmfatene15 Jun
                • Re: Table fullEmmett Bishop15 Jun
                  • Re: Table fullmos16 Jun
                    • Re: Table fullEmmett Bishop16 Jun
                      • Re: Table fullmfatene16 Jun
        • Re: How to write subqueries?Unknown Sender15 Jun
    • Re: How to write subqueries?Unknown Sender14 Jun