sharan has asked for the wisdom of the Perl Monks concerning the following question:
i want to store apple, cat , elephant,dog, banane in one array say as @array1 and banana, dog, flag, home, kite in another array as @array2. Then I have to compare each element of array2 with array1 element. If they are equal, then have to store in a row. I want my output asColumn1 Column2 apple banana; cat dog; elephant flag; dog home banane kite and so on....
my code looks like..Column1 Column2 Column3 apple banana kite cat dog home elephant flag and so on....
Also, how can I split a table(Table T1) having two columns(Column1 and Column2) into two table(T2 and T3) having one column each. i.e. T2 has Column1 and T3 has Column2. But am unable to get the desired output. Many thanks in advance..my $sth = $dbh->prepare("INSERT INTO Test3 values (?,?)"); my $order1 = $dbh->prepare("SELECT Column1 FROM Test3 ORDER BY Column1 +"); $sth->execute($words[0],$words[1]) or die $DBI::errstr; $order1->execute(); while(@row = $sth->fetchrow_array()) { print qw($row[0]\n$row[1]\n$row[2]\n);} $sth->finish(); $order1->finish();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl and mysql column
by ELISHEVA (Prior) on Mar 03, 2009 at 14:39 UTC | |
by Illuminatus (Curate) on Mar 03, 2009 at 15:22 UTC | |
|
Re: perl and mysql column
by bradcathey (Prior) on Mar 03, 2009 at 14:17 UTC | |
by sharan (Acolyte) on Mar 03, 2009 at 14:36 UTC | |
|
Re: perl and mysql column
by toolic (Bishop) on Mar 03, 2009 at 14:11 UTC |