Hello every body.
I have a database with two table Product and DetailBill
Table Product
IDPro NamePro Descrypt ImagePro
Table DetailBill
IDBill IDPro Count Price
I have a procedure
ALTER proc [dbo].[sp_Product_2]
as
select top(9) IDPro,count(IDPro) as SumofPro
from DetailBill
group by IDPro
order by SumofPro desc
I must select * from Product with IDPro bellow , but i can`t .
Can you help me ?
I try
ALTER proc [dbo].[sp_Product_2]
as
Select * from Product where IDPro in (select top(9) IDPro,count(IDPro) as SumofPro
from DetailBill
group by IDPro
order by SumofPro desc)