Re: Create Multi record

From: Bell News <Johnny829_at_hotmail.com>
Date: Thu, 25 Mar 2004 18:15:28 -0500
Message-ID: <nKJ8c.23996$A_2.1266006_at_news20.bellglobal.com>


hi,

For the old table:
IDNUM1 XX YY ZZ (one record FOR ONE IDNUM) IDNUM2 XX YY ZZ
....
IDNUMn XX YY ZZ

suppose the field names for old one are:

KW F1 F2 F3
IDNUM1 XX YY ZZ (one record FOR ONE IDNUM) IDNUM2 XX YY ZZ
....
IDNUMn XX YY ZZ

And the new table has 2 fields: KW and F1, only needs three SQL statements --->

  1. Insert into New_Table (KW, F1) (select KW, F1 from Old_Table);
  2. Insert into New_Table (KW, F1) (select KW, F2 from Old_Table);
  3. Insert into New_Table (KW, F1) (select KW, F3 from Old_Table);

Just try to use insert with sub-SQL.

Johnny Jiang

"Mohammad" <mhakimjavadi_at_hotmail.com> ??????:cc59b627.0403251102.65817289_at_posting.google.com...
> Hi
>
> I am very new in SQL and i need you help.I have record like :
>
> IDNUM1 XX YY ZZ (one record FOR ONE IDNUM)
> IDNUM2 XX YY ZZ
> and I have to make new table of those record like this : (three record
> for one IDNUM)
>
> IDNUM1 XX
> IDNUM1 YY
> IDNUM1 ZZ
> IDNUM2 XX
> IDNUM2 YY
> IDNUM2 ZZ
>
> Please advise.
>
> Thanks a lot
Received on Fri Mar 26 2004 - 00:15:28 CET

Original text of this message