Richard,

If you mean with _both_ the same id _and_ vendor id, try this:

Select id, vendor_id, count(*) from tablename group by id, vendor_id;

If you just want separate counts for id and vendor_id, use:
Select id, count(*) from tablename group by id; 
Select vendor_id, count(*) from tablename group by vendor_id;

Andy
> -----Original Message-----
> From: Richard Reina [mailto:[EMAIL PROTECTED]
> Sent: 23 February 2006 16:48
> To: mysql@lists.mysql.com
> Subject: query help?
> 
> I am a novice when it come to queries such as this and  was hoping someone
> could help me write a query that tells me how many records have the same
> ID and vendor number.
> 
>  |ID     | vendor_no  | date            |
>  |2354  | 578              | "2005-12-23"|
>  |2355  | 334              | "2005-12-24"|
>  |2356  | 339              | "2005-12-26"|
>  |2357  | 339              | "2005-12-26"|
>  |2358  | 339              | "2005-12-26"|
>  |2359  | 445              | "2005-12-26"|
>  |2354  | 522              | "2005-12-27"|
>  |2355  | 522              | "2005-12-27"|
> 
>  Would I use select count? Any help would be greatly appreciated.
> 
> 
> 
> A people that values its privileges above its principles soon loses both.
>  -Dwight D. Eisenhower.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to