Is this query right? [message #375227] |
Tue, 07 August 2001 09:39 |
Oleg
Messages: 7 Registered: October 2000
|
Junior Member |
|
|
I have 2 tables:
1)
hits
------
prod_name varchar
_date date
_time time
2)
orders
------
order_id int
prod_name varchar
total decimal
So can I use the query:
---------------------------------------
select prod_name, count(*) as hits, (select count(order_id) from orders where prod_name = h.prod_name) as orders from hits h group by prod_name order by orders dec
---------------------------------------
to know product name (prod_name), count of the product page hits (hits) and count of orders for product (orders).
Will this query work?
Thanks a lot.
|
|
|