?
Solved

Ignoring NULL data in SQL query?

Posted on 2007-03-20
3
Medium Priority
?
1,217 Views
Last Modified: 2012-05-05
CREATE VIEW [Top Rated Games] AS
SELECT TOP 100 Count(*) AS Cnt, GameID, Rating
FROM tbComments
GROUP BY GameID, Rating
ORDER BY Cnt DESC, Rating, GameID

I need to exclude null data from the "Rating" field. How would I do this?
0
Comment
Question by:ESSGroup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
dbeneit earned 500 total points
ID: 18760504
SELECT TOP 100 Count(*) AS Cnt, GameID, Rating
FROM tbComments
where not Rating is null
GROUP BY GameID, Rating
ORDER BY Cnt DESC, Rating, GameID
0
 
LVL 10

Expert Comment

by:lahousden
ID: 18760505
CREATE VIEW [Top Rated Games] AS
SELECT TOP 100 Count(*) AS Cnt, GameID, Rating
FROM tbComments
where rating is not null
GROUP BY GameID, Rating
ORDER BY Cnt DESC, Rating, GameID
0
 

Author Comment

by:ESSGroup
ID: 18760523
Thanks guys! Works perfect. I gave all points to dbeneit since his reply came first.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question