Table - Products has number of products as below
Productid ProductName
1
iPhone
2
iPad
3
BlackBerry
Table - SalesPersonProduct has the
below records
Salespersonid
productid
S1
1
S1
2
S1
3
S2
1
S3
2
Write a SQL query that returns the number of sales for each
product
Answer Posted / subbareddy.l
Hi,
This query will give us number of sales product wise
select SPP.Productid,COUNT(SPP.Productid)CC from
SalesPersonProduct SPP inner join products P
ON SPP.Productid=P.Productid
group by SPP.Productid
Thanks,
subbareddy.l
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
If any stored procedure is encrypted, then can we see its definition in activity monitor?
what is the difference between openrowset and openquery?
Is it possible to have clustered index on separate drive from original table location?
What is a scheduled job or what is a scheduled task?
Can sql servers link to other servers like oracle?
What is a coalesce function?
How to convert numeric expression data types using the cast() function?
What is sql server query analyzer?
How do I find query history in sql server?
How do I create a trace in sql server?
What are the different SQL Server Versions you have worked on?
How can I check that whether automatic statistic update is enabled or not?
Equi join and non equi join is possible with sql server?
How to enter binary string literals in ms sql server?
How to connect php with different port numbers?