Help with order by

I want to select the same column name from 2 tables, combine them, and give them a certain order but I am getting:
ORA-01785: ORDER BY item must be the number of a SELECT-list expression
select a from table1 where a = 'TYY000007'
union all
select a from table2 where a = 'TXXXXXXXX'
order by TRANSLATE(a, 'ABCDEFGHIJKMNOPQRSUVWXYTL0123456789','0123456789ABCDEFGHIJKMNOPQRSUVWXYTL') DESC;
I know the TRANSLATE works because it will work with just 1 table query and I've used it in other queries.
Please help.

Hi,
Noramally, you can ORDER BY something that is not in the SELECT clause.
In a UNION query, you can't.
if you want to ORDER BY d046d (or something derived from it), then you have to include d046d in the SELECT clause. To avoid displaying it, you can do the UNION in a sub-query, like this:
WITH     union_results     AS
     select a, d046d from table1 where a = 'TYY000007'     -- This is easy to do without a UNION,
     union all                                              -- but that's not the point
     select a, d046d from table2 where a = 'TXXXXXXXX'
SELECT       a
FROM       union_results
ORDER BY  TRANSLATE ( d046d
                      , 'ABCDEFGHIJKMNOPQRSUVWXYTL0123456789'
              , '0123456789ABCDEFGHIJKMNOPQRSUVWXYTL'
              )          DESC
;

Similar Messages

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • Help with ordering prints

    Can anyone help with ordering prints for Shutterfly? I keep getting to step 4 (payment type) and then it just goes to blank page and nothing happens.

    Thanks for your help, I am new to all of this. I think it was my edited pics that were the problem, they were to big of files, I had to go and save them as a new file as a jpeg and then went to shutterfly and downloaded from there. I never could get it to work from Photoshop Elem.
    Date: Thu, 9 May 2013 00:51:58 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help with ordering prints
        Re: Help with ordering prints
        created by vsh07 in Photoshop Elements - View the full discussion
    Looks like some problem! Just try the following steps. They worked for me: 1. Go to shutterfly website (www.shutterfly.com) and log into your account.2. In My Account Section> Billing Information, add your Credit Card details and Save.3. Logout from your account and open Photoshop Elements application to order prints.4. Now,on step4 (payment type),your Credit Card details will appear magically    Let me know if this solution works for you. It can be of some help to other members too.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5304432#5304432
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5304432#5304432
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5304432#5304432. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Need help with order booking tutorial

    Hi
    I am new to OracleFusion.
    Started Learning By practising OrderBooking tutorial for 10g.
    I am practising parellel branching in the tutorial .
    I ve invoked Rapid distributors service in branch 1 of the flow activity.
    and
    i ve invoked Select manufacturing service in branch 2 of flow activity.
    I ve deployed order booking service,rapid distributed service,select manufacturing service in the server.
    Select manufacturing service is an asynchronous service .for this service to be complete it requires user to manually set price for the item ordered.
    So I accesed SelectManufacturinUI in browser as instructed in book.The problem is tht it is directing me to login page where User id and password should be submitted.
    In the tutorial no info is given regarding login details fot this page.Hence i am not able to set price for order.
    So the Select manufacturing service is not completed ..hence i am not able to move further in the tutorial..
    Kindly help with this..if any one has faced same prblm
    thanks

    Hi
    I got the answer. Just posting it so that it helps someone
    User id i tried : jcooper
    password : Bpel console startup password

  • Need help with order by

    Test Data:
      CREATE TABLE "TEST_GMU"
       ( "PZINSKEY" VARCHAR2(255) NOT NULL ENABLE,
    "PXCREATEDATETIME" DATE,
    "PXURGENCYASSIGN" NUMBER(18,0),
    "WORK_PXURGENCYWORK" NUMBER(18,0),
    "MASTERACCNTFIRMCUSTID" VARCHAR2(255 CHAR)
       ) SEGMENT CREATION IMMEDIATE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12858!AMADVISORSERVICESFLOW','16-JUL-13 15.55.57.000000 PM',0,40,'2531215'); 
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12859!AMADVISORSERVICESFLOW','16-JUL-13 15.01.22.000000 PM',0,40,'742254777');
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12860!AMADVISORSERVICESFLOW','16-JUL-13 15.01.23.000000 PM',0,40,'2531215'); 
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12861!AMADVISORSERVICESFLOW','16-JUL-13 15.03.55.000000 PM',0,40,'2568091'); 
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12862!AMADVISORSERVICESFLOW','16-JUL-13 15.03.56.000000 PM',0,40,'742254777');
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12863!AMADVISORSERVICESFLOW','16-JUL-13 15.03.57.000000 PM',0,40,'2568091'); 
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12864!AMADVISORSERVICESFLOW','16-JUL-13 15.06.29.000000 PM',0,40,'742254777');
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12865!AMADVISORSERVICESFLOW','16-JUL-13 15.06.31.000000 PM',0,40,'2568091'); 
    insert into test_gmu values ('ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12866!AMADVISORSERVICESFLOW','16-JUL-13 15.06.32.000000 PM',0,40,'742254777');
    The output required is like below
    1.       AM-12859 BXYZAB CO. 742254777  07/16/2013 15:01:21
    2.       AM-12862 BXYZAB CO. 742254777  07/16/2013 15:03:56
    3.       AM-12864 BXYZAB CO. 742254777  07/16/2013 15:06:27
    4.       AM-12866 BXYZAB CO. 742254777  07/16/2013 15:06:31
    5.       AM-12858 WHIJKL CO.  2531215  07/16/2013 15:01:16       The values of this timestamp is actually '16-JUL-13 15.55.57 in datbase
    6.       AM-12860 WHIJKL CO.  2531215  07/16/2013 15:01:22
    7.       AM-12861 SIJKLM CO.  2568091  07/16/2013 15:03:54
    8.       AM-12863 SIJKLM CO.  2568091  07/16/2013 15:03:56
    9.       AM-12865 SIJKLM CO.  2568091  07/16/2013 15:06:30
    I could work this out till below:
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12859!AMADVISORSERVICESFLOW 7/16/2013 3:01:22 PM 0 40 742254777
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12862!AMADVISORSERVICESFLOW 7/16/2013 3:03:56 PM 0 40 742254777
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12864!AMADVISORSERVICESFLOW 7/16/2013 3:06:29 PM 0 40 742254777
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12866!AMADVISORSERVICESFLOW 7/16/2013 3:06:32 PM 0 40 742254777
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12861!AMADVISORSERVICESFLOW 7/16/2013 3:03:55 PM 0 40 2568091 
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12863!AMADVISORSERVICESFLOW 7/16/2013 3:03:57 PM 0 40 2568091 
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12865!AMADVISORSERVICESFLOW 7/16/2013 3:06:31 PM 0 40 2568091 
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12860!AMADVISORSERVICESFLOW 7/16/2013 3:01:23 PM 0 40 2531215 
    ASSIGN-WORKBASKET SCHWAB-ACE-SERVICEREQUEST-WORK-ACCTMAINT AM-12858!AMADVISORSERVICESFLOW 7/16/2013 3:55:57 PM 0 40 2531215
    with order by masteraccntfirmcustid desc ,pxcreatedatetime
    But one of the developer told me masteraccntfirmcustid should be asc
    This resultset is supposed to be ordered by
    order by masteraccntfirmcustid ,pxurgencyassign desc NULLS LAST ,work_pxurgencywork desc NULLS LAST,pxcreatedatetime
    in the test data I have been given pxurgencyassign and work_pxurgencywork is same for all the records
    Could you please help?
    Thanks,
    swapnil

    the results of the query are not matching the data in the table.  like ....
    1.      BXYZAB CO.
    2.      BXYZAB CO.
    3.      BXYZAB CO.

  • Need help with ORDER BY clause

    Hey,
    I have a table:
    Name: Year:
    Eagle 2000
    Tiger 2001
    Eagle 2002
    Lion 2006
    Lion 1999
    Fox 1991
    Lion 1995
    I need a query which will return in such order:
    Name: Year: Position:
    Eagle 2000 1
    Eagle 2002 2
    Fox 1991 1
    Lion 1995 1
    Lion 1999 2
    Lion 2006 3
    Tiger 2001 1
    So, of course to get Name and Year in this order is quite easy:
    select Name, Year from Animals order by Name, Year;
    but how about Position, is there a way to count it with SQL?
    any help is welcome,
    Silvestras

    SQL> with rt as
      2  (select 'Eagle' nm, 2000 yr from dual union all
      3  select 'Tiger', 2001 from dual union all
      4  select 'eagle', 2002 from dual union all
      5  select 'Lion', 2006 from dual union all
      6  select 'Lion', 1999 from dual union all
      7  select 'Fox', 1991 from dual union all
      8  select 'Lion', 1995 from dual)
      9  select nm,yr,row_number() over(partition by (nm) order by nm,yr) position from rt;
    NM            YR   POSITION
    Eagle       2000          1
    Fox         1991          1
    Lion        1995          1
    Lion        1999          2
    Lion        2006          3
    Tiger       2001          1
    eagle 2002 1
    7 rows selected.
    SQL> with rt as
      2  (select 'Eagle' nm, 2000 yr from dual union all
      3  select 'Tiger', 2001 from dual union all
      4  select 'eagle', 2002 from dual union all
      5  select 'Lion', 2006 from dual union all
      6  select 'Lion', 1999 from dual union all
      7  select 'Fox', 1991 from dual union all
      8  select 'Lion', 1995 from dual)
      9  select nm,yr,row_number() over(partition by lower(nm) order by nm,yr) position from rt;
    NM            YR   POSITION
    Eagle       2000          1
    eagle 2002 2
    Fox         1991          1
    Lion        1995          1
    Lion        1999          2
    Lion        2006          3
    Tiger       2001          1
    7 rows selected.
    SQL> 

  • Need help with Order by statement

    I have a report which has an order by statement to order a varchar2 field in ascending order.
    The report sorts the records correctly but if I rerun the report, the records with the same values in the column that I order by, do not maintain the same order as was in the report's 1st run.
    The records will still be sorted in ascending order but those records that have the same values interchange positions each time I run the report.
    Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.

    user8655468 wrote:
    but those records that have the same values interchange positions each time I run the report.
    Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.Hello,
    It's normal those are same values may interchange at each run. you can add another column in order by clause. That
    Order by column1,column2 may add another column3 -- this will maintain always same but column 1,2,3 have same value , it will may interchange.
    Hope this helps
    Hamid

  • HELP WITH ORDERING A BOOK

    I've been using iPhoto successfully for a while, and like making and ordering books.
    My MacBook had a problem and the IT Manager sorted it - but everything was re-installed.
    All is fine, but I'm trying to order a book, and when I click on the BUY button, nothing happens.
    I've checked Preferences, registered on my account etc. I have no idea how to connect my book to the ordering facility. My internet connection is working.
    Any ideas?

    Welcome to the Apple Discussions.
    registered on my account etc.
    Does that mean you went online and re-entered all of your Apple account information?
    First try deleting the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder, launch iPhoto, reset its preferences and try again.
    If that doesn't help, log into another account on your MBP, create a test library if there is no library there, create a quick test book and try the Buy button. You can abort the purchase process if the Buy button is working.
    If the Buy button doesn't work in the other account a reinstall of iPhoto is warranted. To do so you'll have to delete the current iPhoto application and all files with "iPhoto" in the file name that reside in the HD/Library/Receipts folder. Now reinstall iPhoto from the disk it came on, apply the latest updater and try again.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: The new rebuild option in iPhoto 09 (v. 8.0.2), Rebuild the iPhoto Library Database from automatic backup" makes this tip obsolete.

  • Help with Order creation

    I have a Workflow....
    There I have component Siebel Operation
    (BC is Order Entry - Orders
    Operation is Insert)
    It's work successfully BUT I need to create Order and when I'm creating
    fill some fields with my data...Now it's creating without filling fields
    How to do this using input arguments of siebel operation???

    If "Argument Fields for an Input Argument"
    http://download.oracle.com/docs/cd/B40099_02/books/BPFWorkflow/BPFWorkflow_Reference26.html#wp1168244
    doesn't help, then you need to tell us more exactly what you do and what you can't get to work.
    Axel

  • [10g] Need help with order by clause in hierarchical query

    I have the following sample data:
    CREATE TABLE     bill_test1
    (     parent_part     CHAR(25)
    ,     child_part     CHAR(25)
    ,     line_nbr     NUMBER(5)
    ,     qty_per          NUMBER(9,5)
    INSERT INTO bill_test1 VALUES ('ABC-1','ABC-10',100,1);
    INSERT INTO bill_test1 VALUES ('ABC-1','ABC-20',200,2);
    INSERT INTO bill_test1 VALUES ('ABC-1','ABC-30',300,3);
    INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-1',401,10);
    INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-2',402,5);
    INSERT INTO bill_test1 VALUES ('ABC-10','ABC-155',100,2);
    INSERT INTO bill_test1 VALUES ('ABC-10','HARDWARE-1',200,1);
    INSERT INTO bill_test1 VALUES ('ABC-155','RAW-2',100,4.8);
    INSERT INTO bill_test1 VALUES ('ABC-155','HARDWARE-3',200,3);
    INSERT INTO bill_test1 VALUES ('ABC-20','RAW-1',100,10.2);
    INSERT INTO bill_test1 VALUES ('ABC-30','RAW-3',100,3);And the query below gives me exactly what I want, in the order I want it. However, I am wondering if there is a way to get this order without creating the SEQ column, since I don't need it in my results
    SELECT     part_nbr
    ,     parent_part
    ,     child_part
    FROM     (
         SELECT     CONNECT_BY_ROOT b.parent_part                         AS part_nbr
         ,     b.parent_part
         ,     b.child_part
         ,     SYS_CONNECT_BY_PATH(b.line_nbr,' ')                    AS seq
         FROM     bill_test1 b
         ,     dual
         CONNECT BY     parent_part     = PRIOR child_part
    WHERE          part_nbr     = 'ABC-1'
    ORDER BY     seq
    Results of above query, except with SEQ included in SELECT (just to show what I'm sorting off of):
    PART_NBR                     PARENT_PART                  CHILD_PART                   SEQ
    ABC-1                        ABC-1                        ABC-10                        100
    ABC-1                        ABC-10                       ABC-155                       100 100
    ABC-1                        ABC-155                      RAW-2                         100 100 100
    ABC-1                        ABC-155                      HARDWARE-3                    100 100 200
    ABC-1                        ABC-10                       HARDWARE-1                    100 200
    ABC-1                        ABC-1                        ABC-20                        200
    ABC-1                        ABC-20                       RAW-1                         200 100
    ABC-1                        ABC-1                        ABC-30                        300
    ABC-1                        ABC-30                       RAW-3                         300 100
    ABC-1                        ABC-1                        HARDWARE-1                    401
    ABC-1                        ABC-1                        HARDWARE-2                    402

    Hi,
    As long as there's only one root, you can say ORDER SIBLINGS BY, but you can't do that in a sub-query (well, you can, but usually there's no point in doing it in a sub-query). If the CONNECT BY is being done in a sub-query, there is no guarantee that the main query will preserve the hierarchical order that the sub-query provides.
    The query you posted doesn't require a suib-query, so you can say:
    SELECT     CONNECT_BY_ROOT b.parent_part                         AS part_nbr
    ,     b.parent_part
    ,     b.child_part
    --,     SYS_CONNECT_BY_PATH(b.line_nbr,' ')                    AS seq
    FROM     bill_test1 b
    WHERE          CONNECT_BY_ROOT b.parent_part     = 'ABC-1'
    CONNECT BY     parent_part     = PRIOR child_part
    ORDER SIBLINGS BY     b.line_nbr     
    ;I said the query you posted doesn't require a sub-query. It also doesn't require dual, so I suspect what you posted is a simplification of what you're really doing, and that may need a sub-query. In particular, if you intend to GROUP BY part_nbr, then you need the sub-query. We can repeat the CONNECT_BY_ROOT expression in the WHERE clause (or, now that I think about it, use a START WITH clause instead of WHERE), but, for some reason, we can't use CONNECT_BY_ROOT in a GROUP BY clause; we need to compute CONNECT_BY_ROOT in a sub-query, give it a name (like part_nbr), and GROUP BY that column in a super-query.
    This assumes that there is only one root node. ORDER SIBLINGS BY means just that: children of a common parent will appear in order, but the root nodes, who have no parents, will not necessarily be in order.
    Here's what I meant by using START WITH instead of WHERE:
    SELECT     CONNECT_BY_ROOT b.parent_part                         AS part_nbr
    ,     b.parent_part
    ,     b.child_part
    --,     SYS_CONNECT_BY_PATH(b.line_nbr,' ')                    AS seq
    FROM     bill_test1 b
    START WITH     b.parent_part     = 'ABC-1'
    CONNECT BY     parent_part     = PRIOR child_part
    ORDER SIBLINGS BY     b.line_nbr     
    ;This should be much more efficient, because it narrows down the results before you waste time getting their descendants.
    Using a START WITH clause here is analagous to me sending you an e-mail, saying "Come to a meeting a my office at 3:00."
    Using a WHERE clause here is analagous to me sending an e-mail to everyone in the company, saying "Come to a meeting a my office at 3:00", and then, as people get here, telling everyone except you that they can go back.
    ORDER SIBLINGS BY was introduced in Oracle 9.
    Edited by: Frank Kulash on Dec 9, 2010 2:39 PM
    Added version with START WITH clause

  • Help with ordering a query

    Hi,
    I have written the following query:
    select customer.cust_id as "Customer ID"
         ,customer.cust_area_code as "Customer Area Code"
         ,customer.cust_number as "Customer Number"
         ,sum(calls.elapsed_minutes) as "Total Call Length (Mins)"
         ,sum(calls.elapsed_minutes*calls.rate) as "Total Cost Of Calls £"
    from
         (select cust_id
              ,floor((end_date_time-start_date_time)*1440) as elapsed_minutes
              ,chrg_per_minute as rate
         from phonecall
         ) calls
         ,customer
    where customer.cust_id = calls.cust_id
    group by customer.cust_id, customer.cust_area_code, customer.cust_number, calls.cust_id
    order by customer.cust_id asc
    However on the last line instead of ordering it by customer.cust_id i would like to order it by "total cost of calls" however when ever i try and order it by this i get an error.
    Do i need to assign it to another var before i use it in an order clause?
    Thanks

    I wrote about [url http://forums.oracle.com/forums/click.jspa?searchID=5648765&messageID=1739843]the order of evaluating on select statement recently.
    On the logical, select statement is evaluated in th following order.
    [1-1] from
    [1-2] on (joining)
    [2-1] where (joining)
    [2-2] start with, connect by
    [2-3] where (excluding joining)
    [3] group by
    [4] having
    [5] select
    [6] union, union all, minus, intersect
    [7] order by
    The alias can be referred predefined in this order, but cannot be referred same level or post-defined. In subquery, this principle is affected as same also.
    The table alias and/or the column alias on [1-1] 'from' can be referred all level excluding [1-1], but cannot be referred in inline view (subquery) on [1-1] 'from'.
    select xxx from tab1 a1,(select xxx2 from tab2 a2 where a2.xxx=a1.xxx) -- No Good (This is same level)
    select a1,a2 from (select xxx a1, xxx2 a2 from tab1) -- Good
    select * from (select xxx a1, xxx2 a2 from tab1) -- Good, * explode to a1,a2
    The column alias on [5] 'select' only can be referred on [7] 'order by'.
    select xxx a1, xxx2 a2,count(*) from tab1 group by a2 -- No Good (post defined)
    select xxx a1, xxx2 a2,count(*) from tab1 order by a2 -- Good
    The naming rule of alias must accord with [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements008.htm#i27561]Schema Object Names and Qualifiers.
    So, the alias enclosed by double quotation mark becomes case sensitive.
    In additional, in order-by-clause, we can specified column number on select-clause.
    select empno,ename,sal from scott.emp order by 3; -- this means order by sal

  • Help with order by and group by together

    Hi: I have a table with severity and devicename as two fields. I want a query which returns a list to include the records in the following order: Devicename with the highest severity at the top but all records should be grouped by devicename irrespective of the severity. Essentially I want the devicename record with the highest severity value at the top. Below is an example
    Ticket1, DEVA, Severity:2
    Ticket2, DEVA, Severity:4
    Ticket3, DEVB, Severity:1
    Ticket4, DEVB, Severity:8,
    Ticket5, DEVC, Severity 3
    Query's result should be as follows
    Ticket3, DEVB
    Ticket4, DEVB
    Ticket1, DEVA
    Ticket2, DEVA
    Ticket5, DEVC
    I have tried the following and it doesn't work.
    Select a.devicename, b.severity
    from (
    select DEVICENAME,MIN(SEVERITY) from USERINCISUMMSTATUS group by DEVICENAME ORDER by MIN(SEVERITY) DESC) a,
    USERINCISUMMSTATUS b
    where a.devicename = b.devicename;TIA
    Ray

    Not a grouping but an ordering;
    SQL> with t as (
       select 1 ticket, 'DEVA' devicename, 2 severity from dual union all
       select 2, 'DEVA', 4 from dual union all
       select 3, 'DEVB', 1 from dual union all
       select 4, 'DEVB', 8 from dual union all
       select 5, 'DEVC', 3 from dual)
    select ticket,
       devicename,
       severity
    from t
    order by max(severity) over (partition by devicename) desc,
       devicename,
       severity
        TICKET DEVI   SEVERITY
             3 DEVB          1
             4 DEVB          8
             1 DEVA          2
             2 DEVA          4
             5 DEVC          3

  • HELP WITH ORDERING PHOTOBOOK IN IPHOTO

    HI I HAVE THE LATEST IPHOTO SOFTWARE, BUT I SPENT ALOT OF TIME PREPARING A PHOTOBOOK AND WHEN I TRY TO ORDER IT I GET THE FOLLOWING ERROR MESSAGE:
    * -[NSPlaceholderMutableString initWithString:]: nil argument
    CAN SOMEONE PLEASE HELP ME/
    THANKS

    Does this article contain anything useful?
    (25717)

  • Help with order of request to move in Quality system

    I have a table, search help search help exit.
    I have created a table and a search help in two different requests.
    I have attached the search help to the data element of one of the field.
    My question what should be the order that we have to move the request into Quality system from development.
    I have separate request for search and tables.
    1)if i move tables then its looking for search help and giving me an error
    2)if iam moving search help its looking for tables and giving me an error
    and i have one more question, when i add the search help to the dataelement does the search get attached to the request generated while creating table.
    is is enough to move this request only  or do i need to move both the request
    let me know

    Hello Kajol
    If you want to keep these interdependent objects in separate transport requests then you (or your SAP basis team) should take care that both requests are imported <b>simultaneously</b>.
    The better choise, as already mentioned, is to create a new request containing the object list of both requests. However, if both requests have not yet been released then you can <b>merge </b>the requests (menu<i> Utilities -> Reorganize -> Merge Requests</i>).
    Finally, when you add a search help to a data element you are touching the data element but not the search help. Thus, only the data element will be added to the transport request.
    Regards
      Uwe

  • Help with order

    My college student bought Design Standard CS6MAC UE.  I'd like to request a copy for the home computer.  So, when you don't have all your pertinent info i.e. order number, receipt to install extra copies, how do you download?   I do have a product code and serial number. 

    I strongly suggest that you contact Adobe Customer Support (not Technical Support), and explain to them, what you need. With just a quick read of your post, I am not sure that the S/T EULA will allow what you want to do, but C/S will be able to tell you.
    Good luck,
    Hunt

Maybe you are looking for