List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 22 2002 4:47am
Subject:Re: SELECT statement help
View as plain text  
At 21:21 -0700 9/21/02, Des Dougan wrote:
>I want to extract data into a temporary table such that unique 
>records with the same primary key (in this case an invoice number) 
>are written to one record, with each of the unique fields extracted 
>being written to a separate field in the temporary table record. I 
>have created my temporary table, and a SELECT that pulls out my 
>data, but I can't work out the appropriate syntax to write the 
>unique fields to the invoice record I'm creating. I think I need 
>something like a "while invoice = current value, select..."
>
>I've gone through the documentation, but can't find what I need for 
>the necessary sql.

You're not going to, either.  SQL doesn't act according to your
description.  Well, that's not strictly true.  You *can* come up
with SQL to do this, but it's going to be along the lines of SQL
that generates another SQL statement that you then execute seperately,
and it's going to be a huge mess.

If you *really* want to do this (that, is create a denormalized result),
you're probably better off doing it within the context of a programming
language that lets you manipulate the data outside of SQL.



>
>I'd appreciate any assistance.
>
>Thanks,
>
>
>
>Des Dougan

Thread
SELECT statement helpDes Dougan22 Sep
  • Re: SELECT statement helpPaul DuBois22 Sep
  • MySQL-FrontKevin Smith22 Sep
    • Re: MySQL-FrontIikka Meriläinen22 Sep
      • RE: MySQL-FrontStuart Low22 Sep
      • RE: MySQL-FrontStuart Low22 Sep