Group by clase & SQL standard

Hi SQL hackers ...
I know that Oracle add an implicit "order by"
to the "group by" clause ... but I want to
know if it make ir because of SQL stantard, or
just because implementation details(maybe it
internally order before grouping).
By the way, I was looking in the SQL92 draft,
and I couldn't find something related ... so,
is it common implementors choice? ... one can
expect this implicit "order by" in every SQL92
RDBMS?
Thanks in advance
saludos
dario estepario ...
[email protected]

The SQL92 stadard does not require this and Oracle doesn't always do this order.
Oracle queries usually order by the group by, as a side effect of the group by mechanism, but there are exceptions, especially if an index on the group by columns exists with them in a different order or if there are ananytics in the query. If you care about the order, give it explicitly. If Oracle is already sorting by that characteristic, it will not do an extra sort.

Similar Messages

  • What is the SQL Standard for passing back a 0 in an Amount Field

    So I have an Amount Column in my database. What is the best way and the SQL Standard to pass back a 0 if it is a <NULL>? With a COALESCE statement?
    Thanks for your review and am hopeful for a reply.

    This is UNBELIEVEABLE! I got rid of my TextBox13 all together...Deleted it to start from scratch. And it is still erroring on TextBox13!!! I even checked the Properties List and there is no TextBox13. What in God's name is going on here?!?!?
    Am I missing something???
    Hi ITBobbyP,
    As to this issue, I find that this is a known issue which you can see on the link below:
    http://connect.microsoft.com/SQLServer/feedback/details/649210/bids-sql-2008-r2-warnings-not-clearing
    According to the Feedback, we can workaround this known issue by Re-open the project. And if Warning was in fact resolved, it will no longer show on the Business Intelligence Development Studio (BIDS) "Error List".
    As to your former issue, please refer to the expression post by
    Jingyang Li.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SQL Standard vs Enterprise Edition for SharePoint 2013

    Do all SharePoint 2013 BI features come with SQL Server SP1 Standard Edition?
    Is there any difference if I install SharePoint 2013 on SQL standard edition rather that enterprise edition? 

    No, all BI features come with the Business Intelligence or Enterprise version. Take a look at http://msdn.microsoft.com/en-us/library/cc645993.aspx.
    Yes, there is a difference in how databases are handled when not dealing with BI features. The two largest examples are the lack of being able to snapshot databases (for content database or site collection backups) or perform an online reorganization of
    indexes in Standard.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • SQL standard 2012 licenses for SCCM 2012 R2

    Hi,
    We are implementing SCCM R2 for customer, is the license for SQL standard 2012 included in price for SCCM licenses, we have around 5000 mahcines to be managed also a Secondary with express edition installed .
    can secondary and primary have different version of SQL for replication ? or it should be same version?
    is there a requirement for SQL standard like processor (How many number of processer can be used if this
    license is free of cost for SCCM2012  (any limitations ) )  Is license cost calculated based on processor ?
    also how many DB can be installed with standard on single instance ? can we use it for WSUS, MDT DB?
    how will i get this SQL standard free version from Microsoft any download location.
    Please advise.
    Thanks
    Shuaib

    SQL Server Standard is included with all System Center products. As Tim said CPUs are irrelevant in this case.
    You can use whatever versions of SQL you like as long as they are supported. However isn't it always best to standardise.
    You can install as many databases as you like as long as they are System Center related - the ones you mentioned are OK.
    The customer should download SQL from their Microsoft Volume Licensing Center. If they choose the SQL that is bundled with System Center it will be pre-populated with a license key.
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • GROUP DATA PL/SQL FUNCTIONS CALLABLE FROM SQL

    MAKE GROUP DATA PL/SQL FUNCTIONS (IE. TABLE TYPE PARAM) CALLABLE FROM SQL
    Is it possible to create new group function like AVG or to overload them ?
    null

    Application Developer's Guide (A76939, page 9-60) list a few requirements from user-defined SQL function, and one of them is:
    * It must be a row function, not a column (group) function; in other words, it
    cannot take an entire column of data as its argument.
    But if anyone find a way to do it, please let me know.

  • Changing auth group of a SAP standard Table

    I was wondering if someone could advise what the implications are if I changed the auth group of a SAP standard table (PA0033). 
    Does it affect programs behind the scenes, support packs, upgrades?

    I am not aware of any reason why an authorization group on a SAP standard table should not be changed.
    I have also seen this done for specific infotypes without any problems.
    See the documentation on transaction SUCU and SE54, and SAP notes and some of the discussions here on them.
    Kind regards,
    Julius

  • Dynamic Group Membership - All SQL Computers in a Domain

    I am trying to create groups containing all SQL servers in each domain. I am using the Wizard in the console. However I appear to be having winter blues as I can't work out how to do it. Everything I try results in an empty group.
    Can someone please explain what I need to do to?

    Roger
    Thanks for the input. The code looks logical and I applied it and imported a revised MP. However I am not getting any membership in the group. There is another group membership in the same MP and that populates correctly, so I haven't a clue where I'm going
    wrong. As you can see below my rule is the same as yours, except with a different domain name.
    <Expression>
                 <And>
                              <Expression>
                                           <RegExExpression>
    <ValueExpression>
    <Property>$MPElement[Name="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/NetbiosDomainName$</Property>
    </ValueExpression>
    <Operator>ContainsSubstring</Operator>
    <Pattern>DOMAINNAME</Pattern>
                                           </RegExExpression>
                              </Expression>
                              <Expression>
                                           <Contained>
    <MonitoringClass>$MPElement[Name="MicrosoftSQLServerLibrary6410!Microsoft.SQLServer.ComputerGroup"]$</MonitoringClass>
                                           </Contained>
                              </Expression>
                 </And>
    </Expression>
    Eric

  • SQL EXPRESS - SQL STANDARD

    Hello,
    Can I install the SQL Standard version 2012 over the SQL Spress 2012 version or I need to create a separated server to this migration?
    Tks.

    Can I install the SQL Standard version 2012 over the SQL Spress 2012 version or I need to create a separated server to this migration?
    I guess you want to ask that whether its supported to install SQL Server 2012 standard on server where SQL Server 2012 express is already installed, in that case you can very well install SQL Server 2012 Standard.
    No need to create separate server for this both instances can work side by side
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Question on a Group By/Having SQL Query

    I have a table which lists Users and their Status (Created, Approved, Deleted, etc.) Each status has a timestamp.
    USER_ID | STATUS | TIMESTAMP
    mike | Created | 12:00
    mike | Entered | 1:00
    mike | Approved | 3:00
    mike | Deleted | 4:00
    john | Created | 5:00
    mary | Created | 6:00
    I need to select
    1) all users whose LAST status is "Approved"
    2) users which have at least 1 "Created" but no "Approved"
    Any ideas on how to construct these queries? Thanks

    Hi,
    803777 wrote:
    Thanks a lot Frank. The 2nd Query works great, no issues.
    The 1st query uses Oracle-specific keywords KEEP and DENSE_RANK. Is there a way to re-write it in standard SQL that would run on all DB servers. Thanks again for your help, very much appreciated.This is an Oracle forum. If you want something for another database, you should mention that in your first message, and not wait until someone has spent time writing code that doesn't help you.
    Here's one way to get basically the same results:
    SELECT    user_id
    FROM       table_x
    WHERE       status          = 'Approved'
    AND       (user_id, tmstmp)  IN ( SELECT    user_id
                                     ,         MAX (tmstmp)
                          FROM         table_x
                          GROUP BY  user_id
    ;In case of a tie, this returns the user_id if any of the contenders is 'Approved'.
    You could also use analytic functions instead of an IN sub-query, but I suspect the chances are greater that the IN-subquery will work on different databases.
    P.S. With respect to Query #2, we're lucky because "Created" is the 1st possible status. But if I wanted to see all users who have been "Entered", let's say, but not "Approved" yet, I would have to use the having(case) syntax you mentioned, is that why you said I had to be careful? "Entered" is an intermediate status, after Created but sometime before Approved.Yes, that's exactly what I meant when I said to be careful.
    Here's an example of what I meant when I said to use a CASE expression:
    SELECT    user_id
    FROM       table_x
    WHERE       status     IN ( 'Approved', 'Created')
    GROUP BY  user_id
    HAVING       MIN ( CASE
                        WHEN  status = 'Created'
                  THEN  1
                  ELSE  0
                    END            
               )          = 1
    ;This does not assume that the "good" status is before or after the "bad" status; and it can easily be modified to accomodate any number of "good" or "bad" values, withiout thinking of their sort order. All that matters is that the "good" ones cause the CASE expression to return 1, and the "bad" ones make it return 0.

  • Clustering SQL Standard edition on three nodes as Active/Active/Passive

    Is the limit of Standard Edition clustering of SQL a licensing limit or a technical limit?
    We have an Active/Active cluster (2 nodes, multiple SQL "resource group" installations), and we want to add a third node in to become the passive node for all SQL instances.
    As far as I understand it, we simply configure the each SQL server in the cluster to have only two "possible owners" with a "preferred owner" of an Active node. So, for SQL server "VServSQL1" it could run on Node1 or Node3(passive), with Node1 as preferred
    - then for the SQL server "VServSQL2" we could set it to run on Node2 or Node3 and un-check Node1.
    Can anyone confirm if this will work? What is the limitation with mixing the active nodes within a Windows Failover cluster?

     Hello ,
    Yes we can have SQL Server standard SQLInstance1 on 
    NODE1 and NODE2. Standard SQLInstance2 on NODE 3 and either of NODE2 or NODE1.
    Thank You
    Jayaprakash JO - MSFT

  • Isse with using Grouping Sets in SQL Server 2008 R2

    Hi,
    I created a query in SQL Server 2012 using grouping sets that works fine.  When I try to use the same query in SQL Server 2008 I get an error ("Inccorrect syntax near SETS").
    I researched using grouping sets in 2008 and didn't see any issue with my query.  What is different in grouping sets 2008 vs 2012?
    SELECT tl.ClientRegionCd as [Client Region Code] , tl.ClientRegionDesc as [Region Name], count(tl.CompleteICN) as [Trauma Letters Sent]
    from TORT_Trauma_Letters tl
    Where CONVERT(VARCHAR(26), tl.SecondNoticeSent, 23) between '2014-06-12' and '2014-06-12'
    GROUP BY GROUPING SETS((tl.ClientRegionCd, tl.ClientRegionDesc), ())
    Stacie

    Check this blog post as how to deal with date ranges
    http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
    For your result you can simply achieve your result with UNION ALL, e.g.
    select Client, Region, Letters
    from myTable 
    UNION ALL
    select NULL, NULL, SUM(letters) as Letters
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Group Policy Deployment Acrobat Standard XI Version 11

    I was able to successfully create a Windows 2008 R2 SP1 Group Policy that would be able to distribute the Adobe Reader Application using the Adobe Customization Wizard XI. I tried to use the same procedure from the Adobe Acrobat Standard 11 download from the adobe licensing site and was unable to get the Group Policy to work. The error message that I am getting is...
    The install of application Adobe Acrobat XI Standard 11.0 from policy  Deploy Adobe Acrobat 11 failed. The error was : %%1603
    This is the procedure that I created for deployment of Adobe Acrobat XI using Group Policy.
    How to create a group policy deployment of Adobe Acrobat XI
    Overview:
    This procedure covers the steps needed to create a group policy that will deploy the Adobe Acrobat installation.
    Requirements
    •    Windows 2008 Group Policy
    •    Adobe Acrobat Customization Wizard
         o    ftp://ftp.adobe.com/pub/adobe/acrobat/win/11.x/11.0.00/misc/CustWiz11000_en_US.exe
    •    Adobe Acrobat XI (Version 11)
         o    download from adobe account
    Procedure:
    1.    Download the Adobe Acrobat XI package.
    2.    Extract the contents of the Adobe Acrobat XI package.
    a.    Type msiexec.exe /a AcroStan.msi
    b.    Click Next
    c.    Put in the Network Location Share where everyone can extract the installation.
    d.    Click Install
    e.    The package will then extract to the network location as indicated above.
    f.    Click Finish, once the installation has completed.
    g.    Open the Adobe Customization XI Wizard, and customize the package by selecting the AcroStan.msi file. 
    h.    Customize the AcroStan.MSI installation file   
    i.    Default viewer of PDF files: Make Acrobat the Default PDF Viewer
    ii.    Remove previous versions of Acrobat
    iii.    Run Installation: Silently
    iv.    If reboot is required at the end of installation: Suppress reboot
    i.    Shortcuts: Remove the desktop Shortcut
    j.    Online and Adobe Services: Disable Product Improvement Program: checked.
    k.   Generate Transform File
    i.    Click Transform > Generate Transform File
    ii.   Create an Setup.Ini file in the folder of the Distribution Package.
    iii.  Name the Transform File something useful like “CompanyConfigs”.
    3.    Create a Group Policy to deploy the software package. It is usually best to have a group policy for each software installation package.
    a.    Update the Domain Default Policy with Always install with elevated privileges. This will allow all software deployment packages to install. 
    i.    Computer Configuration > Policies > Windows Settings > Administrative Templates > Windows Components > Windows Installer > Always install with elevated privileges : Enabled.
    b.  Create a Group Policy to enable Windows 7 Verbose Mode
    i.    Computer Configuration > Policies > Administrative Templates > System > Verbose vs normal status messages : Enabled.
    c.    Create a Group Policy for the Software Installation
    i.     Computer Configuration > Policies > Software Settings
    ii.    Right click and select New > Package
    iii.   Click the AcroRead.msi
    iv.   Click Advanced
    v.    Click the Modifications Tab and click Add
    vi.   Optional: Click the Uninstall this application when it falls out of the scope of management.
    Note: This setting can be used to uninstall the application if the group policy ever changes in that the application should be removed.
    vii.    The package is now created …
    4.    Test the Client in a Virtual Machine
    a.    Go to a windows client and run “gpupdate /force”.
    b.    The system will then respond that it needs to restart the computer.
    c.    Type Yes, and allow the computer to reboot.
    d.    If Group Policy is not setup to allow for verbose messages in Windows 7 then the user will just see “Please wait…”, if verbose message is enabled the user will see “Installing Adobe Acrobat…”.
    Can someone please tell me what I am missing to get the group policy deployed? It has the same permissions as the Adobe Reader folder and I have done everything exactly the same, except that Adobe Standard has the license number, and owner information included in the Transform file (.mst).
    Thank you.

    Your case isn't unique. We've heard this a lot. While Acrobat has a small, very small percentage of settings available in the ADMX files,
    in case you don't know, PolicyPak software has a solution to manipulate, basically, near 100% of the settings in Acrobat Reader and Professional.
    You're welcome to check out how it works. These videos are for Acrobat X, but there is also tempaltes in the download for XI.
    Here are links to the pages with full how-to videos:
    http://www.policypak.com/products/manage-acrobat-reader-with-group-policy.html
    and
    http://www.policypak.com/products/manage-acrobat-x-pro-and-acrobat-x-standard-using-group- policy.html
    You can be up and running in 20 minutes, but note, it's NOT a template.. PolicyPak is full application management and lockdown system.

  • Group box vs SQL Reporting Services Bookmark box

    <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Hi,</font></p><p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">My name is Peter Mead. I have started a job where they have a bunch of Reports written using SQL Reporting Services. My job is to convert these reports in to Crystal Reports to be used in an Enterprise Reporting methodology.</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">The first problem I have is that SQL Reporting Services viewer has a Bookmark box down the left hand side. This Bookmark box looks like a Group box but does not function in the same way. SQL Reporting Services designer allows for the creation of any definable bookmark to be placed in this Bookmark box. </font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">How can I replicate or emulate this Bookmark box?</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Thanks in Advance,</font></p><p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Peter Mead</font></p>

    In the grouping dialog, there is an option to create "Specified Groups". This should allow you to emulate that bookmark idea.Â
         - Kathryn Webster (Report Design Consultant)
               Kat&#39;s News: http://diamond.businessobjects.com/blog/279

  • Group By in sql statement....

    I have the following sql statement:
    SELECT ROWNUM AA, EPONYMO||' '||ONOMA FNAME ,CODE_ERGAZOMENOY_TYPE_ID,MV_SIGK_KATAST_MINA.SUM_ODOIP_EXODA,
    MV_SIGK_KATAST_MINA.SUM_HMERISIA_APOZIMIOSI, MV_SIGK_KATAST_MINA.SUM_SINOLO,
    MV_SIGK_KATAST_MINA.SUM_KRATISI_MTPY,
    MV_SIGK_KATAST_MINA.SUM_KRATISI_G_EPIM, MV_SIGK_KATAST_MINA.SUM_KRATISI_TADKY,
    MV_SIGK_KATAST_MINA.ETOS , (SELECT NVL(SUM(DAYS),0) FROM MOD3_PRAGMATOP_ODOIP WHERE
    CODE_ERGAZOMENOY_TYPE_ID=MV_SIGK_KATAST_MINA.CODE_ERGAZOMENOY_TYPE_ID AND
    MINAS||'/'||ETOS BETWEEN :P_MONTH_APO||'/'||:P_ETOS_APO AND :P_MONTH_EOS||'/'||:P_ETOS_EOS) PRAGM_ODOIP ,
    (SELECT DAYS FROM REF_DIKAIOUM_MERES_EKTOS_EDRAS
    WHERE SYSDATE BETWEEN DATES_APO AND DATES_EOS AND
    SEQ_CODE_ERGAZOMENOY_TYPE_ID=MV_SIGK_KATAST_MINA.CODE_ERGAZOMENOY_TYPE_ID) DIKAIOUM_ODOIP , MV_SIGK_KATAST_MINA.SUM_SINOLO-(MV_SIGK_KATAST_MINA.SUM_KRATISI_MTPY+MV_SIGK_KATAST_MINA.SUM_KRATISI_G_EPIM+MV_SIGK_KATAST_MINA.SUM_KRATISI_TADKY) NET_POSO
    FROM MV_SIGK_KATAST_MINA  , REF_ERGAZOMENOS
    WHERE REF_ERGAZOMENOS.SEQ_CODE_ERGAZOMENOY=MV_SIGK_KATAST_MINA.CODE_ERGAZOMENOY_TYPE_ID
      AND MV_SIGK_KATAST_MINA.MINAS||'/'||MV_SIGK_KATAST_MINA.ETOS BETWEEN :P_MONTH_APO||'/'||:P_ETOS_APO AND :P_MONTH_EOS||'/'||:P_ETOS_EOS
    and i want to compute the sum of the above selected columns adding a group by clause.....Is it possible.....?????
    Some sample data...
    MINAS     ETOS     CODE_ERGAZOMENOY_TYPE_ID     SUM_ODOIP_EXODA     SUM_HMERISIA_APOZIMIOSI     SUM_SINOLO     SUM_KRATISI_MTPY     SUM_KRATISI_G_EPIM     SUM_KRATISI_TADKY
    07     2007     161     505,95     508,64     972,74     10,32     25,48     20,28
    07     2007     230     85,3     78,25     163,55     1,59     3,92     3,12
    06     2007     230     0     9,78     9,78     0     0     0
    06     2007     161     421,75     254,31     676,06     5,17     12,74     10,14
    07     2007     26     118,35     303,21     330,81     6,17     15,19     12,09
    05     2007     230     0     9,78     9,78     0     0     0
    07     2007     236     328,25     88,04     407,04     1,78     4,41     3,51I use OracleDB10g...
    Sorry for the format of the sample data.....!!!!
    Thanks, a lot
    Simon
    Message was edited by:
    sgalaxy

    To columns... which do have the 'SUM_' prefix ....such as ...
    EPONYMO||' '||ONOMA ,
    CODE_ERGAZOMENOY_TYPE_ID,
    MV_SIGK_KATAST_MINA.ETOS,
    PRAGM_ODOIP (nested select query),
    DIKAIOUM_ODOIP (nested select query)
    I THINK... I HAVE DONE IT... I'LL CHECK IT MORE CAREFULLY...
    Thanks...a lot
    Simon
    Message was edited by:
    sgalaxy

  • How to group data from SQL queries in XMLP Enterprise Edition

    Hi all,
    I have installed XMLP EE on a windows machine. I tried creating the data set with the type as SQL Query. In my case I have just joined the EMP and DEPT tables from the SCOTT schema:
    select     EMP.EMPNO as EMPNO,
         EMP.ENAME as ENAME,
         EMP.JOB as JOB,
         DEPT.DNAME as DNAME,
         EMP.DEPTNO as DEPTNO
    from     SCOTT.EMP EMP,
         SCOTT.DEPT DEPT
    where DEPT.DEPTNO=EMP.DEPTNO
    and DEPT.DNAME = nvl(:DeptName,DEPT.DNAME )
    I want that the data should be displayed in my report so that for each value of DNAME all the details (EMP.EMPNO, EMP.ENAME, EMP.JOB ) should be displayed as in master detail format in my XML output, so that it is easier to build the template using the <?for-each?> tags.
    Can anyone suggest how I can do this?
    I am facing another error :
    The report cannot be rendered because of an error, please contact the administrator.
    Can anyone help me with this too?
    Thanks.

    Hi
    On the error, have you tried running the report to generate data only ? If that is failing then you have an issue with your query or connection
    On the grouping, hopefully you have the Template Builder installed. That can help you build the grouping you want in the output. For this report and to get you started check out the Table Wizard. There is a screen in that flow allowing you to specify Grouping criteria.
    the following blog article may help too:
    http://blogs.oracle.com/xmlpublisher/2007/05/03#a265
    and this getting started with templates doc
    http://www.oracle.com/technology/products/xml-publisher/xmlpclient.html
    Regards
    Tim

Maybe you are looking for

  • Right/best method to open and close form?

    When i click a button from FormA, it open FormC and it should be the same with button from FormB-used to open the same FormC but it doesn't. this happen when i previously open FormC from FormA before opening it in FormB. I use setvisible(true) to ope

  • How to divide speech and music?

    Hello! I have an audio wma file with music and speech in it (music and speech are not connected to each other). Is it possible to separate speech from music or at least make speech lowder? How to do it with the help of Adobe Audition? Ideal would be

  • How can I start Windows XP Mode when there is no startup link in the Start Menu?

    I have installed and had to uninstall and reinstall Windows XP Mode numerous times on my Dell desktop running Windows 7 Professional and now I cannot start it because there is no startup link in the Program Files folder. When i try to reinstal XP Mod

  • Internal table record checking (Urgent)

    Hi Experts, I have an internal table having records. I want to check each record of the table with every other record to find out if there exist same record for more then one key field. Can anybody help me to place the logic for how i can check the r

  • Oracle Security - Controlling the 'alter user' privilege

    Hi, 1. DB 10.1.0.5 and 10.2.0.3 2. "Admin User" needs to be able to change some users passwords in database. 3. Create user adminuser - grant alter user to adminuser. 4. DBAs will grant "approle" role to list of required users. DBAs will maintain con