calculate average rating in sql server

  • this is my table:

    I want to fetch records of Those Vendor which contain ServiceDescription "Plaster" or Skills "Plaster" or is in Category "Plaster" and also want to calculate averagerating of those Vendor.

    note:If there is no review Of any vendor then also that records should come.

    this is my query:

    select * from UserDetails u

    ,VendorInCategory v

    ,CategoryMaster c

    ,Review rv

    where v.CategoryId=c.Id

    and u.Id=r.UserId

    and u.Id=rv.VendorId

    and v.VendorId=u.Id

    and ((u.ServiceDescription like '%Plaster%' )

    or (u.Skills like '%Plaster%')

    or (c.Name like '%Plaster%'))

    here problem in above query is i am not getting that vendor whose review is not there.

    but i also want that vendor which does not contain review but matches my criteria.

    if u want u can check out whole question at:http://stackoverflow.com/questions/27242641/calculate-average-rating-in-sql-server

    can anybody help me with this query???

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply