What's wrong with this query

Discussion in 'Databases' started by DJOuk, Feb 20, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. SELECT Tickets.TicketID, Tickets.Title, Tickets.Description, Tickets.Software, Tickets.Date, Systems.OS, Rating.DateVoted, Rating.RatingID
    FROM Rating INNER JOIN
    Tickets ON Rating.TicketID = Tickets.TicketID INNER JOIN
    Systems ON Tickets.SystemID = Systems.SystemID
    WHERE (Systems.OS = @osid) AND (Rating.DateVoted >= @date)
    ORDER BY COUNT(Rating.RatingID)

    It's meant to list tickets which match a type of OS and ranks them based on all the amount of rows in the rating table, whose dates are above a speicifed date..
     
  2. In your first select you only grabbed one table before the first join.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page