Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

If any stored procedure is encrypted, then can we see its definition in activity monitor?

1064


what is the difference between openrowset and openquery?

1186


Is it possible to have clustered index on separate drive from original table location?

1034


What is a scheduled job or what is a scheduled task?

1033


Can sql servers link to other servers like oracle?

910


What is a coalesce function?

1275


How to convert numeric expression data types using the cast() function?

1142


What is sql server query analyzer?

1123


How do I find query history in sql server?

1018


How do I create a trace in sql server?

1112


What are the different SQL Server Versions you have worked on?

1077


How can I check that whether automatic statistic update is enabled or not?

1108


Equi join and non equi join is possible with sql server?

1127


How to enter binary string literals in ms sql server?

1235


How to connect php with different port numbers?

1181