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 ? |