Thread: union and count
View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 10:04 AM
Bob Bedford
 
Posts: n/a
Default union and count

Hi all,

I've 3 tables. The first is a table of customers, the second a table of
orders and the third a table of questions.

I've to provide a table with the customerid, the number of orders and the
number of questions.
For every order and every question I've a new record in those table. The
tables are quite huge, so I can't send the structure but basically in the 3
tables they are the customerid number to link for.

As I general idea I'd like something like:

select name from customer, count(ordersid) from orders, count (questionid)
from customer
left join orders on customer.customerid = order.customerid
left join questions on customer.customerid = questions.customerid

Is this possible ? how ?


Reply With Quote