What DB are you using. Just as a matter of interest what happens if you make it
"SELECT page,count(*) FROM $Table GROUP BY page" Also I don't know if this is really the statement you want to execute but the same effect can be acheived with "SELECT DISTINCT page FROM $Table" Ken. -----Original Message----- From: Gary Fung [mailto:[EMAIL PROTECTED]] Sent: 09 January 2003 14:59 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Why can't use SQL "GROUP BY..."? Hi, I have a Perl program using DBI. I don't know why it will cause error when I use "GROUP BY..." in SQL "SELECT" statements. My coding is similar as: $value2 = $dbh->prepare("SELECT page FROM $Table GROUP BY page") || die "Couldn't add record, ".$dbh->errstr(); Whenever I use "GROUP BY.." , an error statement will go out : "SQL ERROR: Can't find table names in FROM clause!" Can anyboby give help to me? Thank You very much!! Regards, Gary Lonely Christmas(陳奕迅),風箏與風(Twins),無間道(電影)... 至In手機鈴聲 陪你過冬天