How does the order by clause in oracle 10G?

Hi This is my table called Master.I want to order by sno. so I run the below mentioned query.

SNO DESC STIME, ETIME CCODE ADD SID

11 11 11 1 10 s11

1 1 s1 09:00 12:00 10

2 2 s2 06:00 07:00 9

3        3      S3        9:00       23:00                         0

SELECT * FROM MASTER BY SNO

SNO DESC STIME, ETIME CCODE ADD SID

1 1 s1 09:00 12:00 10

11      11         s11        11             1              10

2         2         s2           6:00        7:00           9

3         3         S3           09:00     23:00                        0

but I had bad results. Help kindly me.i can't understand how the order by clause is fetching the record.

Hello

Most probably because that SNO is not digital, but a tank.

If it contains a number onlly, try

SELECT * FROM MASTER BY TO_NUMBER (SNO);

Tags: Database

Similar Questions

  • How to remove the Order By clause

    How can I get rid of the Order By clause in the underlying SQL query? I created a simple hierarchy, but when I use the hierarchy in the analysis and then come down, the results show multiple occurrences of each child. For some reason, I was able to reduce the number of occurrences of each child by adding a saved filter.

    I was expecting this:

    Expected.jpg

    Instead, I got this:

    Actual.jpg

    The generated physical query looks like this:

    SET VARIABLE QUERY_SRC_CD = "report"; SELECT s_0, s_1, s_2, s_3, s_4 s_5, (FROM s_6)

    SELECT

    s_0 0,.

    CAST (NULL AS VARCHAR s_1 (1)).

    "Registration - College". «Dimensions of the inscription '.» "' Exercise ' s_2,.

    'All the colleges' s_3,.

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_4 all Colleges").

    MOUNT s_5 (NULL AS DOUBLE),

    "Registration - College". "" Counties of schooling. "" Full-time student "s_6

    "REGISTRATION - College".

    UNION ALL

    SELECT

    1 s_0

    "Registration - College". «Dimensions of the inscription '.» "" Name of College "s_1,.

    "Registration - College". «Dimensions of the inscription '.» "' Exercise ' s_2,.

    'All the colleges' s_3,.

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_4 all Colleges").

    IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". ("' S_5 College ').

    "Registration - College". "" Counties of schooling. "" Full-time student "s_6

    "REGISTRATION - College".

    WHERE

    ("Registration - College". «Dimensions of the inscription '.» ("' Exercise ' IN ('201213')) AND (IDOF ("registration - College". «Hierarchies of the inscription '.» "College". ". (("' Colleges ') (1))

    ) djm ORDER OF 1, 3 ASC NULLS LAST, 4 ASC NULLS FIRST, 5 ASC NULLS FIRST, 2 ASC NULLS FIRST, NULLS FIRST CSA 6

    EXTRACT FIRST 10000000 LINES ONLY

    HI mbengue,.

    Check the report you are running any column presentation sorted in the user interface (in which case the order by clause will creep into generated sqls Physics). Also, I think that its worth it to check the settings of the hierarchy you have configured and if the installation program for the calculation of the measured column (number of students in this case), has been done correctly.

    Kind regards

    Arko

  • How does the Vswitch?

    Hello

    Suppose we have an Esxi host with 2 physical network card and a virtual machine running on it. without grouping of NETWORK cards NIC is chosen to forward traffic outside the Esxi?

    and I want to know in this scenario, how does the Vswitch? It sends the mac address-based frame? Let's say that the two network adapters is connected to the same switch.

    Thank you.

    If you don't want to use the pool (for some reason any) then creating vSwitches with only a single uplink or create multiple groups of ports on a vSwitch with multiple uplinks and override the order of failover on each port group to set vmnic active, standby and unused.

    André

  • How does the BC and calculate shipping UPS?

    How does the BC and calculate shipping UPS? How does he know how many widgets can fit in a box or if a widget is big enough to carry by itself?

    Some of our products are shipping at the right price, and others are far away.

    Are "Product Dimensions" dimensions of the box or widget?

    Thanks for any help.

    Everything is located in one single box no matter how big it is, BC and then calculates a volumetric size of the products, the problem, it's long and thin elements do not get calculated very well and lead to prices being unacceptable for certain types of orders.

    Second question, dimensions of the product should be the size of the box and not the size of the product (for the calculation of delivery somewhat correctly).

    I said that a short time before it can be overcome, but you must calculate your shipment with a 3rd party and then inject in order before ordering, it is out of the box solution, hopefully some new funky BC liquid options come along and fix everything.

  • Purpose of the ORDER BY clause in the analytic function Min Max

    I was always using analytical functions like Min Max without ORDER BY clause. But today I used with the ORDER BY clause. The results are very different. I would like to know the purpose of the ORDER BY clause in Min, Max and analogues of analytical functions.

    user10566312 wrote:
    I was always using analytical functions like Min Max without ORDER BY clause. But today I used with the ORDER BY clause. The results are very different. I would like to know the purpose of the ORDER BY clause in Min, Max and analogues of analytical functions.

    It is a good point that many developers are not so aware. As far as I understand it the way it works.

    Some analytical functions do not need an order by or windowing clause (SUM, COUNT, MIN, etc.). If there is no specified window, then the full score is the window.
    As soon as you add a command also add you a windowing clause. This window has the default value of 'rank ofrows between unbounded preceding and current_row. So as soon as you add an order by clause, you get a sliding window.

    Documentation: http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm

    windowing_clause
    ...
    You cannot specify this clause unless you specified the order_by_clause. Window limits defined by the clause RANGE you can not specify only a single expression to the > order_by_clause. Please refer to 'Restrictions on the ORDER BY Clause'.

    example of

    with testdata as (select 10 numval, level lv from dual connect by level < 10)
    select lv, numval, sum(numval) over () sum1, sum(numval) over (order by lv) sum2
    from testdata;
    
    LV NUMVAL SUM1 SUM2
    -- ------ ---- ----
     1     10   90   10
     2     10   90   20
     3     10   90   30
     4     10   90   40
     5     10   90   50
     6     10   90   60
     7     10   90   70
     8     10   90   80
     9     10   90   90 
    

    Published by: Sven w. on 25 Sep 2012 16:57 - default behavior has been corrected. Thanks to Chris

  • Evaluate the Expression in the order by Clause

    Hello

    I'm struggling to run after JPQL.

    Select r.firstname, r.lastname, (e.distance/e.duration) from Runner r Inner Join r.event e Order BY (e.distance/e.duration) Desc;

    Error suggests that ' (' character is unacceptable in the Order By Clause.) Here is the error.

    javax.servlet.ServletException: java.lang.IllegalArgumentException: an exception occurred while creating a query in EntityManager:
    Description of the exception: syntax error parsing the query [Select r.firstname, r.lastname, (e.distance/e.duration) of Runner r Inner Join r.event e Order BY Desc (e.distance/e.duration);], line 1, column 101: unexpected token [()].
    Inner exception: NoViableAltException (81! = [1328:1: orderByItem returns [object node]: (n = stateFieldPathExpression (a = ASC | DESC = d |) | I = IDENT (a CSA = | d = DESC |)) ;])])

    Can someone show me please how to fix it.

    Thank you
    Adam

    What version do you use? It should work in EclipseLink > 2.1.

    ---
    James: http://www.eclipselink.org

  • Condition in the order by clause?

    Hello

    my version of db is,
         Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production 
        
    Im having a query like this,
        select a,b,c,d,sum(e) from f group by a,b,c,d order by a,b,c,d
        
    Now if the value of one is 1 I want the result of the following query
        select a,b,c,d,sum(e) from f group by a,b,c,d order by b,a,c,d
        
    The only change between the two queries above are sorted by the clause.

    How to get there?

    Good help will be appreciated.

    Concerning
    Sankar MN

    Published by: SankarMCA on October 5, 2010 04:51

    Hello

    You can use CASE expressions in the ORDER BY clause.
    For example:

    ORDER BY  CASE
                  WHEN  a  = 1  THEN  b
                              ELSE  c
              END
    ,         CASE
                  WHEN  a = 1  THEN  c
                              ELSE  b
              END
    ,         d
    
  • What's the point of having several columns in the ORDER BY clause?

    DB version: 10 gr 2

    When you use the ORDER BY clause, the lines are always sorted by the first column in the ORDER BY clause. So, what's the point of having several columns in the ORDER BY clause (I always see this in production codes)?

    For the below SQLs' schema SCOTT, result sets are always classified according to the first column ename. When I added use asc and desc of employment, does not change the result set.
    SQL> select * from emp order by ename;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.
    
    SQL> select * from emp order by ename, job;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.
    
    SQL>  select * from emp order by ename, job desc;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
    
    14 rows selected.

    Search in this example, you will see the difference

    SQL> create table test_order (name varchar2(10), surname varchar2(10), age number);
    
    Table created.
    
    SQL> insert into test_order values('Kamran','Agayev',26);
    
    1 row created.
    
    SQL> insert into test_order values('Kamran','Taghiyev',26);
    
    1 row created.
    
    SQL> insert into test_order values('John','Kevin',23);
    
    1 row created.
    
    SQL> select * from test_order;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    Kamran     Agayev             26
    Kamran     Taghiyev           26
    John       Kevin              23
    
    SQL> select * from test_order
      2  order by age;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    John       Kevin              23
    Kamran     Agayev             26
    Kamran     Taghiyev           26
    
    SQL> select * from test_order
      2  order by age asc, surname desc;
    
    NAME       SURNAME           AGE
    ---------- ---------- ----------
    John       Kevin              23
    Kamran     Taghiyev           26
    Kamran     Agayev             26
    
    SQL>
    

    When in the second query, I sorted out only for age, you saw it there two 26 years old Keita, there was first Agayev, then Taghiyev. But if I want to get the family names in descending order when there are two very old person, then I will add the second column in the order by clause

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • How does the virtual machine BACK to Windows?

    How does the NTVDM?  I run an old DOS program written in Fortran 77, which, with the exception of the database has not changed in 20 years.  It takes about 2 hours to start a business.  My boss told me that I can get a better computer.  Upgrading my computer 3 GB RAM maximum 4 GB will make a difference.  When I use the MEM command, I thought that the memory in use is what I take BACK used, approximately 1 MB.  Am I missing something?  More RAM can help?  Help a different CPU architecture?   The little knowledge by going to various sites, I have gained seems to tell me that dual core or quad processors are unnecessary because BACK is a single processor and use it exclusively.  How about a faster chip.  Is there a limit to the speed that is finished on the BACK.  Then addresses NTVDM maybe all these problems Unlike DOS itself.

    Thanks for your help

    Hello

    Your question better asked during the Forum of Microsoft virtualization, for more specialized assistance on this issue, please repost your request here:

    http://www.Microsoft.com/virtualization/en/us/community.aspx

    Kind regards
    Manasa P - Microsoft Support

     

  • How does the trash?

    OT: Trash.

    How does the trash?

    It seems to be a "sandbox", but a reference to the storage space on each disk.

    I can't find a real situation for the trash

    If I delete a file from the c: drive or the drive e: is the deleted file stored in a different location or the renamed file right on the disc it came? (don't forget the BACK a deleted.doc file was just renamed $eleted.doc)

    Thank you

    In Windows 7, the trash is a named hidden system folder $Recycle.Bin.  There is a file with that name in the root of each of your partitions (e.g., C:\$Recycle.bin, D:\$Recycle.bin, etc.).  Within each of these folders are folders for each user in use on the machine account (there may be additional folders).

    When you double-click on the icon to the trash that is displayed on your desktop that opens is a composite of all files $Recycle.bin for the user account that is active.  In other words, you see the files you deleted all partitions of disk, but you will not see the deleted files of another user of your computer.

    If you right-click on the Recycle Bin icon, you can configure the space used for the $Recycle.Bin records on each partition.  The default size appears in about 10 percent of the first 40 GB on the size of the partition more than 5% of the balance.  As a general rule, you should leave the default size.

    See http://www.csee.umbc.edu/courses/undergraduate/FYS102D/Recycle.Bin.Forensics.for.Windows7.and.Windows.Vista.pdf for more details than you probably want to

  • How does the "CHOOOSE DETAILS"?

    How does the "CHOOSE DETAILS"?

    In the box of dlog OPEN line; (top); You can add to your choicequestions relavant;

    You open the box of selctn 'CHOOSE DETAILS';

    If your choice is LOW, in the alphabet; by using the tab "MOUNT", IS TEDIOUS, one step at a time.

    Is there a way bettter?

    To the extent of moving upwards or downwards,

    You can also drag the list once they are in the display of the page.

  • How does the online Flash Player Settings Manager?

    That's one thing, I've always been curious to know: How does the Flash Player Settings Manager ?

    It's a UI SWF running in a regular reader of Flash, but there obviously access to all kinds of Flash Player settings low level, a typical SWF is not.

    My first guess is that the user interface is in fact built into Flash Player, but then why would you go to visit a website to see? The SWF file is actually be served by the site Web and Flash Player's trust to the Web site to access a low level player not made public API?

    As a Flash developer for many years I've just been curious about this for a long time. Now that the Manager is obsolete by the construction in the settings (which is a lot less mysterious) Manager, I thought I would ask before it is completely forgotten.

    -Aaron

    Yes, the SWF is imbued with special powers, which are linked to the domain that sovereign wealth funds are served from.  The settings are basically just special LSO.

  • How does the task before action?

    VSM 9.1.4

    MSSQL

    Hi guys! How does the special action forward in rules CBT works?

    In this scenario, where the dependent task will go if it is enabled by the CBT?

    1. Task Implementatation is initially assigned to GroupX
    2. CBT rules:
      • If the request Type TypeA, proceed to task, set state of StatusA demand and send the task to the GroupA
      • If the request Type is TypeB, go to the task of technical approval, the Request Status StatusB value and prior approval of the Group b

    test.PNG

    When I tried to simulate this, the task of implementation was not sent to GroupA when the request Type TypeA. Instead, he was sent to the assigned group GroupX. Checked the CBT story and it seems that the rules that has task until the action was never carried out.

    Yes, that's all. I think now I know why it works the way you expect.

    I think that if TCC happens to any rule that meet its criteria of condition, it does not check any other rules in addition.

    So you specify different rules for different conditions, but not for different actions.

    And several actions (for example the Request Status value and before the task) can be combined into a single action like this:

  • Re: How does the data retention?

    Hello guys

    How does the conservation of data in vC Ops? In the document it says data retention in the company is 900 days. But in the vSphere user interface, we can keep up to 4 years, which is by default and the minimum level. These two does not?

    There are also resolutions different weeks, monthly, quarterly, and annual. Suppose for example that if we maintain weekly resolution as 12 weeks and months 10, all the quarters 9 and annual 5 years as shown in the picture how it works? I mean after 12 weeks the data will be deleted, but we said 5 years for recall information. How this is achieved.

    Please help me

    Thank you

    VK

    Let me be more specific:

    1. the colelctor collects data interval 20 seconds every 5 min

    2. it is wrapped in a 5 min avg and max value.

    3. these values 5 min is rolled up to hourly, daily, weekly... ect... for two reasons: capacity and analysis of dynamic thresholds which is stored in two databases diffenent calculations.

    It does not compress the stats... it gets stats avg. (Analysis uses avg to get trends used for forcasting ability... ect)

  • How does the remote collector?

    I'm not clear on the role of remote collector.

    How does the remote collector? He interviews / transmits data to the internal manifold? What is the flow of data?

    Thank you

    -isayani

    Isayani,

    It was stated earlier in this thread - a case of primary use for the remote collector is to collect metrics to an environment that is separated by a logical or physical network complexity.  For example, a demilitarized zone where you want to just open a minimum of connections internally or to a remote location where you have limited network connectivity and wishes to consolidate the collections to save bandwidth.

    You can also choose to add another collector if your vC Ops server is of limited resources.  However, based on the environment of size that you used in your example, there is no advantage and only an additional complexity of having several collectors.

Maybe you are looking for