Outputting group headers without info

Hello,
I'm interested in finding a way to output group headers even
if there is no corresponding group information.
For example, if you have the letters of the alphabet as your
headers, and then under each header list the Title of the movie
that starts with the group header. Well if this is database driven,
and there are some letters missing, like lets say there's no movie
that starts with X and none that starts with V. If you output the
query and put the first letter of the movie as the group header,
the X and the V headers would never show up.
But what if I want those headers to show up, in order to show
the user that this category is blank? I know there is a way in SQL
to do this. I can create a reference table with all letters of the
alphabet and do a left join onto the table with the movies, then
output the query and all letters of the alphabet would show up. I
can do this with a regular table or a temp table.
But I'd like to know if there is a way to do this in CF.
Maybe somehow create a structure with all letters of the alphabet,
and somehow pull the movie titles from the query into the
structure, then output the structure.
Any input appreciated, but please no crazy CF subqueries
(querying the database multiple times within an outer query).
Hopefully this can be done in 1 query, and as few outputs of that
query as possible.
Peter

Hi Simon,
Yes, I know the SQL solution is quicker and preferable, which
I did mention in my first post to this thread.
This question was posted more as curiosity than anything
else. There are times when I'm asked such questions, and even
though I would never bother to use such a solution, it's nice to
know the answer.
BTW, if you have the T-SQL or PL/SQL that would pull the
categories into a single column, then join onto a details table,
could you please post? Would you use temp tables or derived tables,
(ie join two queries?)
Thanks,
Peter

Similar Messages

  • Nested Group Function without Group By Problem

    Hey everyone,
    I have 3 tables as below:
    TABLES
    ITEM (Item_no, Item_price, desc)
    DeliveryItem (delivery_no, item_no, quantity)
    Delivery (delivery_no, delivery_date)
    SELECT desc, MAX(SUM(quantity)) FROM DeliveryItem, Item, Delivery WHERE Item.item_no = DeliveryItem.item_no AND Delivery.delivery_no = deliveryitem.delivery_no;
    And I'm trying to output description of most delivered item but I got an error like SQL Error: ORA-00978: nested group function without GROUP BY. Could you help me to fix my code?
    Thanx

    Hi,
    DESC is not a good column name; you could get errors if the parser thinks it means DESCending. I used DESCRIPTION instead, below.
    I think the best way is to do the SUM in a sub-query, lkike this:
    WITH     got_r_num     AS
         SELECT       item_no
         ,       SUM (quantity)     AS total_quantity
         ,       RANK () OVER (ORDER BY  SUM (quantity) DESC)     AS r_num
         FROM       deliveryitem
         GROUP BY  item_no
    SELECT     i.description
    ,     r.total_quantity
    FROM     got_r_num     r
    JOIN     item          i     ON     r.item_no     = i.item_no
    WHERE     r.r_num     = 1
    ;If you want to do it without a sub-query:
    SELECT       MIN (i.description) KEEP (DENSE_RANK LAST ORDER BY SUM (di.quantity)
                        AS description
    ,       MAX (SUM (quantity))     AS total_quantity
    FROM       deliveryitem     di
    JOIN       item          i     ON     d1.item_no     = i.tiem_no
    GROUP BY  i.description
    ;If you do nested aggegate functions, then every column in the SELECT clause must be an aggregate applied to either
    (a) another aggregate, or
    (b) one of the GROUP BY expressions.
    That's why you got the ORA-00937 error.
    This second approach will only display one row of output, so If there is a tie for the item with the greatest total_quantity, only one description will be shown. The RANK method will show all items that had the highest total_quantity.
    It looks like the delivery table plays no role in this problem, but it there's some reason for including it, you can join it tpo either query above.
    Of course, unless you post test copies of your tables (CREATE TABLE and INSERT statements) I cn't test anything.
    Edited by: Frank Kulash on Nov 6, 2010 10:57 AM

  • How do i send a group email without showing recipient names?

    hi
    i would like to ask how do i send a group email without showing recipient names - without using bcc!
    i have seen that peple send group emails and only the only info that appers is the: from and to emails are the same as the sender email.
    how do i do that?
    isnt there any app for Gmail to do that?
    i am using gmail
    thank you

    If you address the email to yourself and then put all your recipients in the bcc it appears to each recipient as if they got your email. In other words they will not see anyone else's name or even their own name - just yours.

  • Group Headers are not getting displayed in crystal report

    Hi,
    I have got 1 reprot having 8 subreports in it. In the parent report I group by 2 different fields. I have created 8 diff. sections under 2nd group and put every subreport in different section. The data in subreport gets displayed depending on the parameters selected by user.
    Sometimes the group headers get displayed. Most of the time when I add only 1 subreport. As & when I add 2 or 3 it disappears.
    Can any body guide me in this issue.
    Thanks a lot...

    Deepa,
    Your issue might appear due to the sub report not being able to grow.
    This can be done by right-clicking on the sub report and select 'can grow' on the general tab of the properties.

  • Can I send a text to a "group" contact without selecting each individual member?

    Can I send a text to a "group" contact without selecting each individual member?  I have a group formed in my contacts, but I still have to select each member in that group to send a text or email from my phone.

    There are apps that allow you to address sms messages to groups (such as Speed Names: https://itunes.apple.com/us/app/speed-names-contacts-groups/id285124918?mt=8), but not iMessages.  Perhaps this will change with a future iOS update.
    The only point of having them at the moment is to allow you to limit the view to only contacts belonging to a group, so that you can more easily add the individual members of the group.  But at the present time, you still have to add them individually.

  • PO without Info record Updation

    Dear All,
    I hope you all are fine and this is my first message to this forum.
    We have a client specific requirement and in that client wants PO without Info Record updation. Info record will be there but for Material and Vendor only not for Price.
    The situation is when we create a PO, the Price will not be pick up from Info Record conditions and from last PO Price.Means we have to manually enter the price and the info record will not be updated for price and cleint's other requirement is  in the info record Order price history is not to be updated when any PO is created.
    Please let me know the steps if anyone works on this issue.
    Havea good day
    Regards
    Lovkesh

    Hi Lovkesh,
    First of all dont create a info record manually.
    Just go a PO with inforecord indicator turned on.
    this will make a info record to be created automatically by the system when u post the PO.
    this inforecord will be with or w/o plant depending on the setting u specify in customizing under define condition control at plant level in SPRO.
    then under customizing for buyer values select not to copy from the last purchasing document.
    info record gets updated in 2 ways normally 1> from previous PO document 2> from conditions entered manually or if the info record update was turned on in any of the purchasing documents.
    after blocking these 2 ways info record will not get updated.
    also make sure in ur case for the material and vendor combination there exists any quotation or agreement orcontractbecause inforecord gets updated automatically if it is turned on(info update indicator) in these purchasing documents also----if  any of these exists then select no update of inforecord in all of them.
    reply me to get updated
    raja.

  • Hello. I am trying to change the colors on my ical. I have been able to select a calendar group, click "get info" and then "other" in the color options and which point a a lot of color options are available. HOWEVER, I can't seem to select the color.

    Hello. I am trying to change the colors on my ical. I have been able to select a calendar group, click "get info" and then "other" in the color options and which point a a lot of color options are available. HOWEVER, I can't seem to select the color. I click on a new color and press enter and nothing happens...not sure what I am doing wrong.

    What do you currently see?
    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Do you have the menu bar?
    *Press the F10 key or tap the Alt key to bring up the hidden Menu bar.
    Do you have any toolbars visible at all?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: Command+Shift+F).
    *https://support.mozilla.org/kb/how-to-use-full-screen
    You can check for problems caused by a corrupted localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • Nested group function without group xmlagg

    I am getting nested group function without group by xmlagg when using the xmlagg function inside another xmlagg function. Find the table structure and sample data here,
    CREATE TABLE "TEST_TABLE"
       ("KEY" NUMBER(20,0),
        "NAME" VARCHAR2(50 ),
        "DESCRIPTION" VARCHAR2(100 )
       Insert into TEST_TABLE (KEY,NAME,DESCRIPTION) values (1,'sam','desc1');
       Insert into TEST_TABLE (KEY,NAME,DESCRIPTION) values (2,'max','desc2');
       Insert into TEST_TABLE (KEY,NAME,DESCRIPTION) values (3,'peter',null);
       Insert into TEST_TABLE (KEY,NAME,DESCRIPTION) values (4,'andrew',null);
    select
            XMLSerialize(document
            xmlelement("root",
             xmlagg(
               xmlelement("emp"          
               , xmlforest(Key as "ID")          
               , xmlforest(name as "ename")
               , xmlelement("Descriptions", 
               xmlagg(
                  xmlforest(description as "Desc")
           ) as clob indent
           ) as t   
          from test_table;Then i removed the xmlagg function from the above select query and used xmlelement instead
      select
            XMLSerialize(document
            xmlelement("root",
             xmlagg(
               xmlelement("emp"          
               , xmlforest(Key as "ID")          
               , xmlforest(name as "ename")
               , xmlelement("Descriptions",            
                  xmlforest(description as "Desc")
           ) as clob indent
           ) as t   
          from test_table;This is working fine, but xml created with empty elements for Descriptions element for key 3 and 4 which has null values. I need don't need Descriptions element in the xml when it has null value. Please help me to resolve this.

    You can do it with a correlated subquery :
    SQL> select xmlserialize(document
      2           xmlelement("root",
      3             xmlagg(
      4               xmlelement("emp"
      5               , xmlforest(
      6                   t.key as "ID"
      7                 , t.name as "ename"
      8                 , (
      9                     select xmlagg(
    10                              xmlelement("Desc", d.description)
    11                              order by d.description -- if necessary
    12                            )
    13                     from test_desc d
    14                     where d.key = t.key
    15                   ) as "Descriptions"
    16                 )
    17               )
    18             )
    19           ) as clob indent
    20         )
    21  from test_table t;
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    <root>
      <emp>
        <ID>1</ID>
        <ename>sam</ename>
        <Descriptions>
          <Desc>desc1_1</Desc>
          <Desc>desc1_2</Desc>
          <Desc>desc1_3</Desc>
        </Descriptions>
      </emp>
      <emp>
        <ID>2</ID>
        <ename>max</ename>
        <Descriptions>
          <Desc>desc2_1</Desc>
          <Desc>desc2_2</Desc>
          <Desc>desc2_3</Desc>
        </Descriptions>
      </emp>
      <emp>
        <ID>3</ID>
        <ename>peter</ename>
      </emp>
      <emp>
        <ID>4</ID>
        <ename>andrew</ename>
      </emp>
    </root>
    Or an OUTER JOIN + GROUP-BY :
    select xmlserialize(document
             xmlelement("root",
               xmlagg(
                 xmlelement("emp"          
                 , xmlforest(
                     t.key as "ID"
                   , t.name as "ename"
                   , xmlagg(
                       xmlforest(d.description as "Desc")
                       order by d.description -- if necessary
                     ) as "Descriptions"
             ) as clob indent
    from test_table t
         left outer join test_desc d on d.key = t.key
    group by t.key
           , t.name
    ;Edited by: odie_63 on 11 juil. 2012 14:54 - added 2nd option

  • How to Suppress Group Headers????

    Hi all,
    Iam working on this report in which I have
    a format trigger to suppress the
    null records.The records are not displayed
    however the group headers &
    the heading in the margin continue to
    be displayed.Also how can I remove
    the Blank spaces being displayed as a
    result of the null records being suppressed??
    Any help in this regard will be appreciated.
    TIA
    sg

    To remove the null spaces you need to make the fields vertically variable, this is because it reserves the height of the boilerplate regardless of whether or not it is displayed. If you make it variable the field will contract to nothing when it is empty. Make sure you do this to each field on the row or it will still reserve the space - colouring them in can help inspotting which is appearing and which isn't.
    Hope this helps,
    Helen

  • Can we generate a report on master data alone without Info cube?

    Could some one let me know whether
    Can we generate a report on master data alone in BEx without Info cube?
    Thanks in advance.

    yes you can generate a report .
    use the master data infoobject and insert that infoobject as a infoprovider and design a query using this infoprovider and view your query on this master data in Bex Query...
    cheers
    Sunil

  • How to create a PO for a Material having Net Price but without Info Record?

    Hi,
    When I try to create a PO for a Material having Material Master and Vendor Master maintained but no Info Record, system does not accept the Net Price and the Price Condition also does not appear. Is there any way to create a PO for a Material having Net Price but without Info Record?
    Regards.

    Hi,
    The first time you create a PO for a material/vendor combination, then system will not prompt any price as info record or valid conditions have not been found.
    The next time you create a PO for the same material, then the price will be defaulted/found from the order price history from the info record(As info record would be reated after the first PO is created) and the latest PO price for the mat/ven combination would be found.
    Hope you are clear with this..Any doubts revert back.
    Regards,
    Deepak.

  • Process security headers without removing them

    Does anyone know whether it is possible to have OSB process security headers without removing the headers from the message?
    I would like to be able to validate the signature and grab the principal from the certificate in order to determine whether the request should be allowed to continue on. However, the signature cannot be removed from the message because the business service requires requests to be signed (and the requests must be signed by the original requester, not an intermediary).
    See Process security headers without removing them also
    Helmar

    I don't know a way of doing this with OSB, I mean having the bus do it for you. It's either process all security headers or none. If the service bus is acting as a pass-through, not processing the headers, you could read them yourself inside the proxy pipeline. But you would have to implement the decryption yourself, this won't be done by the bus. You could do this with a java callout, but I imagine it won't be trivial task.
    I'd think this is pretty standard. The headers normally are intended for a service (maybe going through various intermediaries), hence the actor property of the headers, and that service should remove them after processing them. But I'm not familiar with Oracle's ESB to know if this is possible with it.

  • Change channel group mode without down time.

    Hi All,
    I'm trying to find a way to change the channel group mode on our access switch from mode on to mode active.
    The port on access switch and core switch are configured like this : channel group X mode on
    The goal is to change this config to channel group X mode active with no down time of the switch.
    Please let me know if you have any ideas to do that.
    Fabien.

    I don't think its possible to change a Channel Group Mode without downtime.
    Changing from On to Active will cause the port to start sending LACP messages in order to form an LACP Port-Channel.
    As you are taking a link down, I suspect spanning-tree will also try and reconverge.
    The downtime should be fairly minimal though, do you have a maintenance window?

  • Purchasing Group in Purchase Info Record

    Hello Gurus,
    The Purchasing Group in Purchasing Info Record is not read at Purchase Requisitions...
    My operation is as below;
    1. Create Purchasing Requisitions via MRP
    2. Assign Fixed Vendor at MD57 or via Source List ( when source list, Fixed Vendor will be assigned at MRP)
    3. Vendor and sometimes Purchase info rec # are assigned to Purchase Requirement
    But Purchasing Group is not assigned to Purchase Requisition.
    I understood that Price is not assigned at Purchase Requisitions, but nor Purchasing Group is not assigned although it is mandatory field in Purchase Info Record at SAP standard..
    Would you tell me how to read Purchasing Group from Purchasing Info Records into Purchase Requisitions?
    Best Regards,
    AK

    Hello,
    Hm, now it is like this;
    - Actually, One Purchase Organization is fixed for the Plant
    - But since we use the same purchase organization, the organization customization was set as below;
        --  Purchase Organization- Company Code: Blank for the Purchase Organization
        --  Plant - Purchase Organization: one Purchase Organization is set for all the Plants
        --  Plant - default Purchase Organization: blank since this seems to be effective only for consignment etc
    -> And the PR which was created via MRP, there is no Purchase Organization assigned....
    I do not know why...we have Plant in the PR but blank for Purchase Organization..
    And it seems that, if I could assign purchase organization to PR via MRP, Purchase Group should be read into PR..
    Edited by: Asayo Kasai on Jan 18, 2011 2:15 PM
    Edited by: Asayo Kasai on Jan 18, 2011 2:15 PM

  • Condition Groups in Purchase info record

    Hi SAP Folks
    Can you please in undertsanding the usage of the Field : Condition Groups in Purchase info record .
    How can this be used and what are the required set up to be done  in the system.
    We are SAP ECC 6.0
    Thanks for the help.
    Achu

    Hi,
    Click F1 on field Cond. Grp which gives the infomation about the Condition groups.
    Check  links : http://help.sap.com/saphelp_47x200/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Condition group comes under strategic sourcing and it is used to group together vendor  & mass changes for vendor masters.
    e.g to change tax condition for certain group. Check the T-code MEKG.
    Hope it will help U...
    Regards
    Vikrant

Maybe you are looking for

  • Itunes doesnt recognize my iphone 3gs after i upgraded to ios4.1

    itunes doesnt recognize my iphone 3gs after i upgraded to ios4.1

  • Pricing procedure picked up from the service order not from the contract

    Hello, All I am working on CRM 5.0 service order and service contract, While creating a service order a popup screen shows that there is a contract which should be assigned, after assigning the contract an error message appears showing that a conditi

  • Frequent freezes after MobileMe update... any cure?

    Since the MobileMe update yesterday, my 2.66GHz Dual Core Intel Mac Pro (running Leopard 10.5.4) has been freezing for up to 60 seconds at a time. It has happened across all applications, including the Finder. It does not crash the OS or applications

  • Flickr error in new Aperture

    Since updating to the newest Aperture, it will occasionally go mad when without internet connection (e.g. when waking from sleep) and spew out an endless stream of alerts that it can't connect to Flickr. Very annoying!

  • Cannot create new Solution

    Hello. I've a new installed and patched Solution Manager 7.1 stack level 10. I'm trying to create a new Solution from workcenter SolutionManagerAdministration. Using NEW button , I fill the pop up with the new solution name, default language left Eng