How do you restrict rows returned in a group by query

I have a select statement with a "group by" and a "order by"
clause and I want the number of rows returned restricted to the
first 10. Normally this is easy using rownum but it does not
work in my case with the "group by" and a "order by" clauses.
Any ideas anybody?
select remote_host,
sum(bytes_transfered) total_bytes_transfered from proxy_log
where bytes_transfered > 0
group by remote_host
order by sum(bytes_transfered) desc

how about:
select * from
(select remote_host,
sum(bytes_transfered) total_bytes_transfered from proxy_log
where bytes_transfered > 0
group by remote_host
order by sum(bytes_transfered) desc )
where rownum <=10
It's not pretty , it may not be clever, but it does work (at
least in 8.1.6)
rgds, APC

Similar Messages

  • Moving controls about on a VI's front panel. How do you get a reference to a 'grouped' set of controls?

    Basic problem (annoying, if not disasterous - but common - at least for me):
    When you are trying to sktick two different VIs together and you copy the block diagram of one to the other, it sticks all the controls in the middle of nowhere.  THen you have to spend about 10 mins dragging the controls screen by screen from one end of the diagram to the other - sometimes over 15 screens.  Surely there has to be a better way?
    ** Incidentally you might think that labview would have these sort of settings in the 'properties' of the control on the right click menu - but no joy.
    I guess the obvious thing is that you can write a VI which will get a reference for a particular control and then say set it's position (x,y) to zero.  Only thing is that generally there will be a selection of controls, and often they will be organised nicely - after getting them to zero you don't want to have to reorganise them again.  I tried grouping the controls, but then the problem is - how do you get a reference to a group of controls.  If you move one of them it doesn't keep the spatial arrangement.  At this point i have got lost - and easily spent more time than it is worth fixing this problem.
    Any thoughts?
    Solved!
    Go to Solution.

    If I understand you correctly, when you copy the block diagram from the second VI to the first, the controls of the second VI end up in far left field on the front panel of the first, correct?  I think these added controls will maintain their relative locations among themselves so you should be able to find them all as a group out in left field. Then it's simply a matter of how to get them to enmasse join the rest of the controls on the front panel. There are a couple of easy ways to do this. There is a button on the toolbar at the top of the front panel window that allows you to reorder/group/ungroup front panel objects. You can select all controls/indicators out in left field and "group" them together. (As an alternative, you can also drop them all onto a tab control which will act as container for them). Then you select this group and with it selected scroll back over to the existing front panel and find and ALSO select (hold down shift key) a control/indicator from the existing group too. Then with BOTH the existing control selected and the new group (or tab control with the new group) selected you use the ALIGN buttons to quickly bring a corner of the new group into alignment with the old control. At that point you can ungroup the new stuff and move it where it needs to be. 

  • How to Increase the Rows and Columns Size of Bex Query in Enterprise Portal  of SAP  7.3

    Dear All,
    Please let me know the process how to Increase the Rows and Columns  Size of Bex Query in Enterprise Portal  of SAP  7.3 .
    Currently I am getting Only  4 columns and 10 rows in One Page .And I am getting 1,2 etc tabs for both row and column. So i want to increase the column length more than 100  and row length more than 10000.
    Please suggest me a suitable solution to over come this issue.
    Please find the Below screen shot.
    Thanks
    Regards,
    Sai

    Dear All,
    Please find the attached screen shot.
    The report be open with 4 or 5 columns and 5 or 6 rows.
    So, please  let me know how to increase the length of the table.
    Do the needful for me to over come this issue.
    Thanks
    Regards,
    Sai.

  • HT2486 How can you put same contact in a Group multiple times so that you can print the same mailing label multiple times?

    How can you put same contact in a Group multiple times so that you can print the same mailing label multiple times?

    Hello,
    Avery...
    https://discussions.apple.com/thread/2588943?start=0&tstart=0
    Or...
    http://www.belightsoft.com/products/labelsaddresses/overview.php

  • How do you send an email to a group in iCloud?  I can't find the group - only the individuals.

    How do you send an email to a group in iCloud?  I can't find the group - only the individuals.

    Shootist007, I think Cdf15 wants each recipient to see his/her own email address.
    Cdf15, you can't quite do what you asked with Mail alone, but you can come close with a slight variant of what Shootist007 recommended. Just put a dummy address (perhars the sender's) in the To field and all recipient addresses in the Bcc field. That way, no recipient sees either the other recipients' addresses or their own.

  • HT2486 How do you address an email to a group from iPhone.

    How do you address an email to a group from iPhone.

    Lisacarmen28 wrote:
    Has anyone figured out how to do this??? Apple, it is absolutely ridiculous that you can't create a basic group email. This is BASIC stuff. Why do you have to make it so impossible to do something standard. No wonder people are moving to Android. SORT IT OUT.
    you create the group on the server side.
    I have no issue creating a group contact and using those contacts.

  • How do you send an EMail to a group of contacts?

    how do you send an EMail to a group of contacts?

    Other than selecting each of the contacts individually, in the native Mail app, you can't. You'll need to explore third party mail apps from the app store for that.

  • How do you add a Spry Collapsible Panel Group?

    How do you add a spry Collapsible Panel Group? When I go to
    the Insert -> Spry there is only a Spry Collapsible Panel
    option, not group. Do I have to download an update? Is there
    something wrong with my install?
    I appreciate any help.

    Hi Lithium,
    The Spry features in Dreamweaver are a subset of the total
    features in the Spry framework. The CP Group is not an option in
    the Insert Bar, but it is pretty simple to write the code for it.
    I am sure you have seen the sample for it:
    http://labs.adobe.com/technologies/spry/samples/collapsiblepanel/CollapsiblePanelGroupSamp le.html

  • How do you restrict access to custom applications?

    When I create portlets, there is usually an associated "admin" functionality that needs to be created for each custom application. An example is a shopping cart that we just created, we needed admins to be able to go in and upload photos.
    The way that I do this is I create a new portlet "Shopping Cart Admin" and restrict access to it that way. However, because I usually add everything in the /remoteserver/shoppingcart/. folder to the gateway space (its too painful to add one by one), this means that I can't put admin.aspx in that folder. So I usually end up creating a NEW folder /remoteserver/shoppingcartadmin/ for the admin portlet.
    Long story short, its a lot of work. I know that I could try to use activity rights, but those seem very global. How do you control edit access to your custom portlets?

    Well, there are a few different ways to go about it. You could add a preferences page with the admin functionality, and then an admin would just have to click the little pencil in the portlet titlebar. No admin/edit access, no little pencil.
    I have often set the visibility of an ASPX control directly from activity rights, in OnPageLoad, if it isn't postback time. The activity rights should be inherited by the user, through the user's group. Best practise is to create empty groups called Roles, add activity rights to the Roles, and then have the actual groups (that contain users) inherit from one or more Roles.
    You already knew that part, I added it for the others. My personal definition of a portlet is 'polymorphous instance of a web service'.
    So:
    Role: Store Manager (has Edit Shopping Cart activity right)
    ^
    Group: Store Managers (has Store Manager parent group)
    User: Vladimir (inherits Edit Shopping Cart activity right)

  • How to increase the row and Column length of Bex query in EP Portal 7.3

    Dear All,
    Please let me know the process  to Increase the Rows and Columns  Size of Bex Query in Enterprise Portal  of SAP  7.3 .
    Please  let settings to increase rows up 10000 and column 100 in one page.
    Thanks
    Regards,
    Sai

    Dear All,
    Please find the attached screen shot.
    The report be open with 4 or 5 columns and 5 or 6 rows.
    So, please  let me know how to increase the length of the table.
    Do the needful for me to over come this issue.
    Thanks
    Regards,
    Sai.

  • How do you get FF4 to recall tab groups after browser restart?

    I keep creating tab groups (name them) but after I close down Firefox and start it up again the groups are no longer there.
    Is this a bug, a feature, or am I missing some kind of "Save Groups" step?

    What they need to do is make a way to '''save the group names''' you create so that you can recall a group whenever you want; sort of like how a group/folder of bookmarks would recall.
    This way if you are working on multiple projects and you group your tabs by project you can just close the projects you aren't working on at that given moment (rather than leaving hundreds of ''unnecessary-at-the-time'' tabs open for who knows how long).
    Then when you're ready to jump back in to that task/project you can just type in the group name or select some flyout to open up all of the relevant tabs.

  • ASA WebVPN. How do you restrict access to users in an AD group using LDAP?

    Hi All,
    I am trying to configure separate WebVPN connection profiles to give different portal bookmark contents to users based on their AD group membership.  This has been very difficult, even though I beleive it should be easy.
    The login page of teh ASA by default has a dropdown to allow default users to access the default portal and the SSL VPN client connection.
    There are two other portals that I would like to restrict access to based on AD group membership.  I have set these up to be selected by URL.
    The biggest problem is, I have no way of knowing how to go about this.  The AAA LDAP options show a group membership search, which I have configured, but I cannot say "Profile X is restricted to AD group CarpetBaggers", so that if soneone that is NOT a carpetbagger tries to log in, it fails.
    I can only do an all or nothing scenario.
    It would be nice to use Dynamic Access Policies to do this, and I have created a few, but they do NOT seem to work when the drop down aliases or URLs are in use.  So how do I go about using them in this scenario?  Turning off the aliases or URLs is not really an option right now.
    Scenario 1 would work the best for me.  Restrict access to profiles/groups based on AD group membership using LDAP.
    Scenario 2 would be an ideal longer term solution.
    Any thoughts, ideas or assitance would be greatly appreciated.
    Cheers

    This is exactly what i was looking for, and Nelson is correct.  When you enter the DAP configuration for a profile click on "Advanced" and there is the option to create a logical expression.  The guide (ther is a button to access this) is really helpful, with a couple of examples.  This is what i used:
    assert(function()
       if ( (type(aaa.ldap.distinguishedName) == "string") and
            (string.find(aaa.ldap.distinguishedName, "OU=Users") ~= nil) )
    then
           return true
       end
       return false
    end)()
    from the debug dap you can see what Users relates to;
    DAP_TRACE: Username: MyUsername, aaa.ldap.distinguishedName = CN=Mr B,OU=Users,OU=Site ******,DC=CH,DC=Mycompany,DC=com
    My admin account fails to get me in to the same profile:
    DAP_TRACE: dap_add_to_lua_tree:aaa["ldap"]["distinguishedName"]="CN=Admin Mr B,OU=Admin Users,OU=Site *****,DC=CH,DC=Mycompany,DC=com"
    Thanks
    Andrew

  • How do you restrict web browsing to view only specified sites for business use?

    Hello, I need to restrict the use of Firefox and Internet Explorer to only specified websites that we use for business use.
    I have a problem with a number of employees using unauthorized and dangerous websites that have put my business computers at risk.
    Since it is impossible to police the employees viewing habits in real time, I need to restrict the viewing. How do I set up a list of only allowed sites that can only be overridden by admin privileges despite user accounts?

    You will have to block such unwanted sites in a firewall or router or proxy and only allow access via that proxy.<br />
    All other ways can easily circumvented, by starting Firefox in [[Safe mode]] if it is an extension or by using a portable Firefox version.
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    # Shockwave Flash 10.0 r45
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • How to capture all the rows returned from a sql select query in CPO

    Hi,
      I am executing an sql select query which returns multiple rows. I need to capture the values of each row to specific variables. How do I proceed.
    Thanks,
    Swati

    The select activities  ("Select from Oracle," Select from SQL Server," etc.) against database already return tables.  Use one of the database adapters to do your select, and it will already be in a table form.  Just put your query in the select and identify the columns in your result table. The online help or the database adapter guides in the product documentation can help.

  • How do you restrict the number of table columns on the data tab?

    I have a table with 50+ columns. Is it possible to restrict the list of columns on the data tab to say 5 columns as I'm only interested in seeing/updateing the data for these 5 columns. You can restrict the number of rows using the filter but not the columns. Is there some other way seeing an updateable "view" of the table? I suppose you could create a number of views and edit through them but there are too many combinations.
    regards
    Paul P

    I don't know of any way of reducing the number of columns that display in the Table data grid.
    However, you can rearrange the columns to have the five columns you want to edit as the first five. With fifty columns, even this would be some effort to find and drag them to the left of the view, but it should give you the five columns you want to update on the window at the same time.

Maybe you are looking for