Can we have ORDER by along with SQLX functions?

Hi All,
I have used the following SQL query to generate a XML file.
select XMLElement("rowset", XMLForest('yyyymmdd hh:mm',"file_date", 'yyyymmdd' "business_date"),XMLElement("privilege", XMLForest(user_name "User_Name",user_role "User_Role"))).extract('/*')
from (
select * from
((select user_name, user_role from a
union
select user_name, user_role from b) tab_a,
(SELECT TO_CHAR (current_timestamp, 'YYYYMMDD HH:MI') file_date,
(SELECT TO_CHAR (business_date, 'YYYYMMDD')
FROM c) business_date
FROM DUAL) tab_b)
group by business_date, file_date;
Can someone suggest how to modify this query in order to sort the rows on user_name and then user_role?
Thanks in advance.
Annie

Why not just use an ORDER BY clause? Also, it's always very helpful to post any SQL code in \ tags so it's readable.SELECT XMLElement("rowset", XMLForest('yyyymmdd hh:mm',"file_date", 'yyyymmdd' "business_date"),XMLElement("privilege", XMLForest(user_name "User_Name",user_role "User_Role"))).extract('/*')
FROM
SELECT *
FROM
SELECT USER_NAME, USER_ROLE FROM A
UNION
SELECT USER_NAME, USER_ROLE FROM B
) TAB_A
SELECT TO_CHAR (CURRENT_TIMESTAMP, 'YYYYMMDD HH:MI') FILE_DATE
SELECT TO_CHAR (BUSINESS_DATE, 'YYYYMMDD')
FROM C
) BUSINESS_DATE
FROM DUAL
) TAB_B
GROUP BY BUSINESS_DATE, FILE_DATE
ORDER BY USER_NAME /* ORDER BY CLAUSE HERE */
, USER_ROLE;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Need Help Can i use Merge command along with exist function in oracle?

    I am using Merge command to update the destination table and updating the rows which are already in the destination table.
    But what i want is to delete the existing rows from the destination table and insert fresh rows instead of updating the existing rows in the destination table.
    So can we use exist function to check the existing rows and delete them and use merge command to insert the rows in the table.

    You definitely need to do a DELETE then INSERT since MERGE will not delete rows, although I'm not really sure what that gets you since the net effect would be the same as a MERGE over the same pair of tables.
    If you really want to do it this way, then I would likely do something like:
    DELETE FROM target_table
    WHERE (columns_you_would_match_on) IN (SELECT columns_you_would_match_on
                                           FROM source_table
                                           WHERE predicate_you_would_use_in_using);
    INSERT INTO target_table (column_list)
    SELECT column_list
    FROM source_table
    WHERE predicate_you_would_use_in_using;John

  • Can you have two different users with itune accounts on the same computer?

    Can you have two different users with separate itune accounts on the same Ipad?

    Yes, create another user profile on the computer and each user can log into their own profile that way.

  • HT204053 can i have multiple iCloud accounts with the same Apple id

    Can i have multiple iCloud accounts with the same Apple id

    Welcome to the Apple Community.
    No, your ID is essentially your account. You can have email aliases and you can have multiple accounts, but I don't think that's what you are asking.

  • Can you have multiple iCloud's with one Apple ID?

    Can you have multiple iCloud's with one Apple ID?

    You can have multiple iclouds with multiple id's

  • Since I have iOS7, I can't have any USB connexion with my Macbook pro!!!! even after another my iphone was exchanged, I think there is a bug in IOS7!!!

    Since I have iOS7, I can't have any USB connexion with my Macbook pro!!!! even after another my iphone was exchanged, I think there is a bug in IOS7!!!

    philippefromfra wrote:
    Since I have iOS7, I can't have any USB connexion with my Macbook pro!!!! even after another my iphone was exchanged, I think there is a bug in IOS7!!!
    Sounds like a bug in Macbook pro. May be bug in the cable? Everything bugged up on you.

  • Can we have a ui:tableRowGroup with in  ui:tableRowGroup...?

    can we have a ui:tableRowGroup with in ui:tableRowGroup
    please help me by providing a code snippet

    The short answer is no. A slightly longer answer.
    There were attempts to compile Java to native code. I remember playing with such a compiler: TowerJ. If you do this, you will end up with native executables, but not only one. You will have one per platform. Hopefully you will find compilers like this for all platforms (unlikely) or at least to all platforms you expect your application to run on. Compiling Java like this is complex and it may have all kind of restrictions.
    Symantec VisualCafe (out of business) now, provided a feature by which you could turn your Java program into a Windows executable. It was a bid executable containing a small native stub, the VM started by the stub, all the JDK classes and all your classes. It was still running under a VM, but this fact was hidden from you. I am pretty sure this concept is alive, just Google for it.
    If you drop the requirement "without VM" only to "without user having to install the JRE", you can survive. You can package the Sun VM with your application (legal, but read the conditions) and than install both. The user does not know what you install, the VM is just another component of your application among others that make it work. You do not need an installer for this, a ZIP with all the stuff inside does the trick.
    Note that again, you will need to create separate installers/zips for every platform supported, because the JRE part is not the same.

  • Can  i have a connected mode with lightroom 5 for my SONY SLT-A77V ?

    can  i have a connected mode with lightroom 5 for my SONY SLT-A77V ?
    thanks for anwers.

    Hi,
    Haveee a look here for Tethered Camera Support: http://helpx.adobe.com/lightroom/kb/tethered-camera-support-lightroom-4.html

  • As. Fashion designer can I use illustrator cc along with photoshop cc

    As  a fashion designer can I use illustrator cc along with photoshop cc
    @is illustrator cc compatible with photoshop cc?

    Thank you so much for answering my question. It was a great help.
    SIncerely,
    Gail Sarasohn

  • Hi, how can i have a live chat with one of the people from apple so i they can help me with my problem?

    hi, how can i have a live chat with one of the people from apple so i they can help me with my problem?

    https://getsupport.apple.com/Issues.action

  • Can I update my iPod video1 with search function like iPod video2?

    Can I update my iPod video1 with search function like iPod video2?
    how could I do?
    I have already download and installed iTunes 7.0.2
    thx

    The Search feature is currently only available on iPods which shipped with it; no publicly available download will add it to older iPods.
    (19614)

  • I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection?

    I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection and remove all the other stuff?

    Very easily. I have an iPod touch and iPad on the same account with totally different content.
    If you use iTunes, connect each iPad to your computer and open iTunes and deselect any automatic updating/syncing. If you don't sync with iTunes but have them set up independently, under the settings, App Store, turn off automatic downloads for apps, etc.
    I'm old fashioned, I set up and sync my iPad and iPod to my computer and iTunes. Each device has a different name  and I manage content manually and only allow sharing on what I want shared.

  • How do I skip the credit card process on itunes? I click to get something for free, sign in, and then it asks for credit card information. Any have any ideas so I can skip that and go along with my process?

    I really need help y'all cause I'm getting frustrateD!

    When it asks you for your credit card, just go along with it until it asks you what type you have then just check off none.

  • HT1918 i have ordered from itunes with my credit card but got a gift card for xmas I redeemed it but cant get it to take to buy music can you help me

    I have a gift card but had ordered music before with a credit card  I redeemed the gift card but its not leting me buy music with it keeps wanting my Credit card info?

    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card - http://support.apple.com/kb/HT2534 - only works for new accounts!  You must follow the instructions exactly.
    Since you already have an account you probably don't want to make another one (you cannot merge them later).  Or I guess you could for the sake of the free stuff and then carefully manage your accounts in future.

  • BAPI for Order Confirmation along with measurement reading entry

    Hello Experts,
    I would like to know if there is any BAPI for PM Order completion Confirmation along with measurement reading entry?
    Thanks in advance.

    [BAPI for TECO|Function Module for TECO(technically complete) a maintenance work order;
    [BAPI to create Measurement document|BAPI or Function Module for creating measuring point;
    Based on the business transaction, by using user exit, you can accomplish these.

Maybe you are looking for

  • External hard Drive on AX (Airport Express)

    Hi...I know a lot of replies to this question ahve been a 'no', but I bought Airport Express froman Apple Store after having expressley (no pun intended) explained what I wanted to use my wireless network for – to connect 2 computers (G4 mirrored rdr

  • Unable to install clean Recovery & Application/drivers on new hard drive

    My HDD failed on Satillite P25-s526. I replaced it with OEM new drive. Also upgraded the RAM from 512mb to 2GB's. I have attempted to do a full recovery of the system using DVD which came with the computer.  DVD formats partitions in new HDD, loads t

  • How to create queries on multiproviders& what are steps to be taken.

    Hi all, How to create queries on multiproviders& what are steps has to be take care. Thanks, cheta.

  • Flat file requirement

    I have received this Flat file which contains data for new products which currently do not have SAP material # assigned to them. The format is : Material#       qty D1          10 D2          20 D3          30 Now when later , one of this new product

  • I checked IMEI when I bought it, but now apple says serial number has been replaced

    I recently bought an iphone 5 from craigs list. Before I did, I called Verizon wireless and had them check the IMEI number and make sure its clean. THey said it is, I even asked her 3 different times "so youre sure that this item is not stolen or rep