On Fri, 2003-01-10 at 00:33, Philip Newton wrote:
> On Thu, 9 Jan 2003 22:59:03 +0800 (CST), [EMAIL PROTECTED] (Gary fung)
> wrote:
> 
> > 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!"
> 
> Others have pointed out the possibility that $Table may be empty. I'd
> like to add that I think there's another error -- as far as I know,
> GROUP BY can only be used when you have aggregate functions such as SUM,
> MAX, COUNT(...) etc. (For example, "SELECT custno, count(ordernum) FROM
> orders GROUP BY custno ORDER BY 2 DESC" to select the customers together
> with the number of orders, grouped by customer but sorted by number of
> orders.)
> 
> Did you mean ORDER BY, perhaps?

Or perhaps "select distinct page from $table"?

-- 
Jeff Boes                                      vox 616.226.9550 ext 24
Database Engineer                                     fax 616.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
           ...Nexcerpt... Extend your Expertise


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to