Better Way to Query?

2006-05-08 Thread Eric J. Hoffman
Not getting good results from this: SELECT COUNT (customer_orders.corder_id) as TOTOT, client.company FROM customer_orders JOIN customer_orders_prod on customer_orders.corder_id = customer_orders_prod.order_id JOIN

Re: Better Way to Query?

2006-05-08 Thread Jim Wright
Just throw a DISTINCT in the count, and you should be ok... SELECT COUNT (DISTINCT customer_orders.corder_id) as TOTOT, client.company -- Jim Wright Wright Business Solutions [EMAIL PROTECTED] 919-417-2257

RE: Better Way to Query?

2006-05-08 Thread Hua Wei
You may want to try GROUP BY client.id, client.company Instead of GROUP BY company -Original Message- From: Eric J. Hoffman [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 3:50 PM To: CF-Talk Subject: Better Way to Query? Not getting good results from this: SELECT COUNT