RE: [PHP] Insert group by
| From: | admin | Date: | Fri, 27 Apr 2012 15:38:02 +0000 |
| Subject: | RE: [PHP] Insert group by | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317714@lists.php.net to get a copy of this message | ||
$sql='select count(*) as count, searchkeywords
from searchkeywords
group by searchkeywords
having searchkeywords LIKE searchkeywords
order by count desc'
Ir this does not work for you explore the HAVING CLAUSE
-----Original Message-----
From: Rick Dwyer [mailto:rpdwyer@earthlink.net]
Sent: Thursday, April 26, 2012 8:23 PM
To: PHP-General
Subject: [PHP] Insert group by
Hello all.
This is more of a MySQL question, but I'm hoping it can be answered here.
On one of my pages, I issue a SQL command to group data as such:
$sql='select count(*) as count, searchkeywords from searchkeywords group by
searchkeywords order by count desc'
Works well... but I would like it to groups plurals with singular words as
well. So "hats" are grouped with "hat".
Since I'm doing a "group by" column name, I don't know that this can be
done.
Any help is appreciated.
Thanks,
--Rick
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php