From: Christian Mack Date: March 12 1999 8:17pm Subject: Re: How do I give a name to a result.... List-Archive: http://lists.mysql.com/mysql/147 Message-Id: <36E9764F.918259C@compal.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Penphoe wrote: > > I sent this email out a few days ago, and I think it got lost in the email > shuffle. Anywayz, if anobody could help me out, it would be much > apreciated! > > LaterZ! > Darren!! > > -----Original Message----- > From: Penphoe > To: mysql@stripped > Date: March 10, 1999 3:26 PM > Subject: How do I give a name to a result.... > > >Is there a way to give the result of a query a temporary name? I was > >looking through the docs, and MySQL doesn't support views yet, and its "as" > >statement is a little different than what's in my Silberschatz text. > > > >Here's what I'd like to do: > >SELECT first_name, last_name, donation_id FROM > >Sponsors LEFT JOIN donations ON > >Sponsors.sponsor_id = donations.sponsor_id > >ORDER BY last_name, first_name > >[as sponsor_donation(first_name, last_name, sponsor_id) #this is what's in > >my db text] > > > >The result of this query, is of course a table with three columns: > >first name, last name, and sponsor id. I'd like to store this in a > >temporary > >table. Is there any way to do this without using an outfile? > > > >LaterZ! > >Darren!! Hi Darren Yes you can of course create a temporary table and do an: INSERT INTO .... SELECT..... And then use this temporary table for what you intend to do. Tschau Christian