Home » RDBMS Server » Server Administration » Is this query right?
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.
Previous Topic: Re: Windows 2000 & Oracle 8i
Next Topic: SQL 7.0 Security question. How do I force my SQL server to query the SAM database on the NT Server o
Goto Forum:
  


Current Time: Fri Jul 05 10:25:30 CDT 2024