in reply to DBI, SQL query problem

as per previous answers, they should get you almost there. what i'm concerned about (warning lights/sounds) is that your data model is not normalised, which makes the SQL harder to figure out than it ought to be. it also makes the SQL very dependent on some intrinsic nature of your data. I could be wrong of couse -- but then state what's the primary key of this table? The table looks harmless enough; but it will keep biting you back if it's not normalised.
the hardest line to type correctly is: stty erase ^H