need quick help with Perl - how to populate tables



Hi,
I need quick help with Perl
(Unfortunately, my level of Perl does not exceed "Hello, World"
program...)

Please, if you can - be very descriptive for the scripts - so, i can
customize it to fit my Queries.

Here is the problem:

I have a table similar to tbl_Have and I need to populate Tables
tbl_need1 and tbl_need2 with Data from tbl_Have.

Please note: to populate data only with the first 4 records
i.e. for the id =7
only first 4 records are used.

Please, let me know if you need additional explanation.
Thanks ahead!

PS. I'm using MySQL 4.0.


tbl_Have
___________
|id| data |
|_________|
|1 | a |
|1 | b |
|1 | c |
|2 | d |
|2 | e |
|7 | f |
|7 | g |
|7 | h |
|7 | i |
|7 | j |
|7 | k |
|9 | l |
|9 | m |
|3 | n |
__________|


tbl_need1 (only First 4 Records)
_____________
|id| data |
_____________|
|1 | a,b,c |
|2 | d,e |
|7 | f,g,h,i |
|9 | l, m |
|3 | n |
_____________|


tbl_need2 ( only 4 columns needed)
____________________________________
|id | data1 | data2 | data3 | data4 |
____________________________________|
|1 | a | b | c | |
|2 | d | e | | |
|7 | f | g | h | i |
|9 | l | m | | |
|3 | n | | | |
____________________________________|

.



Relevant Pages

  • how populate Tables?
    ... I need quick help with Perl ... to populate data only with the first 4 records ... let me know if you need additional explanation. ... PS. I'm using MySQL 4.0. ...
    (comp.lang.perl.misc)
  • Re: DELETING records using MYSQL Database
    ... you don't have the rights for a local infile operation for that mysql ... ask the Perl Guys to run the infile op as a perl script with your file - ... mySql / VFP / MS-SQL ... > remote table - DELETE FROM, I want to repopulate it with data from ...
    (microsoft.public.fox.vfp.queries-sql)
  • script help to update member profiles
    ... form is all stored in a MySql Database (First Name, Last Name, Username, ... my partner that did all the perl scripts was injured ... Compare entered username and password to database to confirm the user is ...
    (comp.lang.perl.misc)
  • DBI / DBD / MySQL installation problem
    ... I used to run Red Hat 9, and had a perfect relationship with Perl, DBI, ... able to connect to MySQL from Perl via DBI. ... Running install for module Mysql ...
    (perl.dbi.users)
  • unable to make SELECT take variables
    ... I am working on a MySQL /Perl web site. ... PERL and am making progress. ... I want to sort and print the mailing labels from the database. ...
    (perl.dbi.users)