in reply to Re: perl and mysql column
in thread perl and mysql column

First, if you want to extract and compare two columns, your query needs to select two columns. Your query is only extracting column 1.
It's worse than this. You define 2 SQL operations, an insert and a select. You are doing the fetchrow on the insert, which is unlikely to do much of anything.

Sure sounds like homework to me. If you want help:

  1. use mysql cli to display the table you want to parse, and cut/paste that to your post
  2. supply code that actually runs (but may not be doing what you want), instead of a snippet that references undefines (ie, @word), and clearly does nothing.
  3. There are many, many ways to accomplish the comparison/sorting you want. If you don't even know how to go about figuring out common elements in 2 arrays, then your issue is foundational.