W
wny2u
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 | | | |
____________________________________|
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 | | | |
____________________________________|