Re: counting records
| From: | Jason Wong | Date: | Wed, 22 May 2002 03:30:07 +0000 |
| Subject: | Re: counting records | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19347@lists.php.net to get a copy of this message | ||
On Wednesday 22 May 2002 11:02, CrossWalkCentral wrote:
> OK when i pull data oout of the database i want to count the number of
> records where 3 field are the same.
>
> I have 6 fileds
> field1=my first name
> filed2=my last name
> filed3=my email
> filed4=other
> field5=other
> field5=other
>
> I want to count the records that have the same field1,field2, and field3.
>
> so i know how many submissions a person has made,
Try:
SELECT count(*),
field1,
field2,
field3
FROM table
GROUP BY field1,
field2,
field3;
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Small is beautiful.
*/