Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TOP in SQL

Status
Not open for further replies.

Knicks

Technical User
Apr 1, 2002
383
US
I have some nested queries and a linked query I use to get percents patient insurance types for a provider. I then take this query and make a graph using only the TOP 10 through the properties of the SQL in the graph. The graph is linked via the Provider code. The odd thing is that provider code does not need to be in the output of the SQL statement in the graph but works fine linked to the group header in the report. The graph looks at plan_codes percent already calculated in a previous query and plan_codes.

Now, what I am trying to do is now that I have the Top 10 plan codes percent per provider, I am trying to somewhere somehow show the percent of what's not listed as a whole. So ultimately I would call this "other" and simply total its percent. So how do I get the Not Top 10???

Using the TOP feature is tough as adding other fields to create links gets me strange results. Any suggestions would be helpful.

 

Maybe something like....
Code:
SELECT yourFields
FROM yourTable
WHERE something NOT IN
(SELECT TOP 10 ...etc)


Randy
 
Thanks,

I'll give it a try, I did try using just "NOT" Top 10, but perhaps the inclusion of NOT IN will do it.

The Top feature seems to have major limitations, at least when trying to do comparisons...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top