List:General Discussion« Previous MessageNext Message »
From:Pascal Délisle Date:August 3 2003 7:43pm
Subject:Re: Nested SELECT statements problem
View as plain text  
Since I'm new to mySQL, could you point me how to create temporary 
tables dynamically?

Le dimanche, 3 aoû 2003, à 15:32 Canada/Eastern, Jim McAtee a écrit :

> ----- Original Message -----
> From: "Pascal Délisle" <masterpace@stripped>
> To: <mysql@stripped>
> Sent: Sunday, August 03, 2003 1:02 PM
> Subject: Re: Nested SELECT statements problem
>
>
>> Finally, I solved my problem by creating a temporary table that holds
>> the result of the subquery.  So, it looks like this:
>>
>>
>> CREATE TABLE livreTemp (IDLivre int(11));
>>
>> INSERT INTO livreTemp (IDLivre) SELECT book.IDLivre
>> FROM livre book, livreEcritPar ecr, auteur aut WHERE aut.Prenom like
>> '%$firstName%' AND aut.Nom like '%$lastName%' AND ecr.IDAuteur =
>> aut.IDAuteur AND book.IDLivre = ecr.IDLivre;
>>
>> SELECT book.IDLivre, aut.Prenom, aut.Nom FROM livreTemp book,
>> livreEcritPar ecr, auteur aut WHERE ecr.IDLivre= book.IDLivre AND
>> aut.IDAuteur=ecr.IDAuteur;
>>
>> DROP TABLE livreTemp;
>>
>> The only problem I see is when there are concurrent access to the 
>> table
>> "livreTemp", e.g. when there are multiple simultaneous requests of 
>> that
>> kind.  Is there a better way for achieving this under mySQL 3?
>
>
> Can you dynamically generate a unique name for your temporary table?
>
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?unsub=1
>

Thread
Nested SELECT statements problemPascal Délisle3 Aug
  • Re: Nested SELECT statements problemDan Nelson3 Aug
    • Re: Nested SELECT statements problemInc Eternal Designs3 Aug
  • RE: Nested SELECT statements problemLin Yu3 Aug
    • Re: Nested SELECT statements problemPascal Délisle3 Aug
      • Re: Nested SELECT statements problemPascal Délisle3 Aug
        • Re: Nested SELECT statements problemJim McAtee3 Aug
          • Re: Nested SELECT statements problemPascal Délisle3 Aug
        • Re: Nested SELECT statements problemMatthew McNicol3 Aug
        • Re: Nested SELECT statements problemDan Nelson3 Aug
  • Re: Nested SELECT statements problemAdam Fortuno4 Aug