Hi,

        Is $Table defined before the prepare is executed?  I've used group
by in perl without issues.  The error returned is complaining about a
missing table name, so I can only conclude that $Table is either blank or
undef when the prepare statement is executed by perl.

Regards,
Michael Nhan

> Date: Thu, 9 Jan 2003 22:59:03 +0800 (CST)
> From: "[big5] Gary Fung" <[EMAIL PROTECTED]>
> 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手機鈴聲 陪你過冬天
>

                ---//---
I don't need to compromise my principles, because they don't have the
slightest bearing on what happens to me anyway.
                ---Calvin (Calvin & Hobbes).


A computer lets you make more mistakes faster than any invention in human
history - with the possible exceptions of handguns and tequila.
                ----Ratliffe, M.



Reply via email to