aftabn10 Posted April 8, 2009 Share Posted April 8, 2009 First post here http://www.phpfreaks.com/forums/index.php/topic,246962.0.html but been told to try and ask on this board as TOPN is a MSSQL command. I have written the following query that returns the top 10 items from a column. I am looking to change this to give me the top 10 Percentage from the same column but dont know how to change my query. Could somebody please help. The following is my query: SELECT "TEST AHT By Agent".RootirID saw_0, "TEST RE Values Dim"."Queue Name" saw_1, "TEST AHT By Agent"."Agent ID" saw_2, "TEST AHT By Agent"."AHT -OM" saw_3 FROM Genesys_TEST WHERE ("TEST RE Values Dim"."Queue Name" LIKE 'Queue 1 ') AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) ORDER BY saw_0, saw_1, saw_2 Currently within my query I have the following: Code: [select]AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) which gives me the top 10 values within the TEST AHT By Agent column. What i would like is for it to give me the top 10% which would mean it gives me a total of 6 values as the total entries within the TEST AHT By Agent column is 56. Hope that makes sense. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/153163-topn-command/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.