You place your order by number Char field

I have a char with data field.

Required order is lower.

Column1

-------------

12

12-A

12-B

122

122-A

122-C

123

123-A

123-B

I have to order both at the level of form and report.

Pasha

Lahore, Pakistan

The 'trick' is pad strings or a part of them to the same length. In your case, it may be sufficient for the whole string if lpad suffix (A, B, C) are always of length 1.

Otherwise, you will need to split the string at the position of the hyphen and lpad for both parties.

Ah, now I see that you do not always have a suffix. Just so add an artificially.

As the length, you must choose a value greater or equal to the maximum length of the string or their parts RESP.

order by lpad (decode (instr (column1,'-'), 0, column1 |)) ((' - 0', column1), 10, '0')

or

Select Column1 from)

Select

Column1

, max (length (decode (instr (column1,'-'), 0, column1 |))) (((' - 0', column1))) on len)

tab

)

order by (lpad, len, '0')

Tags: Database

Similar Questions

  • You place your order by number.

    Hello
    I have a report that I would like to order by order of calendar. By that, I mean I already know the order in which I'm supposed to get these results. This is what the data would look like.
    Student Category      Total Students     Total Fee Amount
    =========================================================
    61                              9999       999,999,999.00
    64                              9999       999,999,999.00
    6A                              9999       999,999,999.00
    65                              9999       999,999,999.00
    66                              9999       999,999,999.00
    67                              9999       999,999,999.00
    68                              9999       999,999,999.00
    68A                             9999       999,999,999.00
    69                              9999       999,999,999.00
    60                              9999       999,999,999.00
    48                              9999       999,999,999.00
    As you can see that if I stopped my request based on the category student, then 48 would come up to high and 6 would come after 69 so spoil the order. My question is:

    Is there a simple solution or this would require the construction of a PL/SQL table? Don't want to spend too much time, if it's really not as simple as that.

    For any help or suggestion is welcome.

    Thank you!

    Try something like this:

    order by decode(student_category
                   ,'61',1
                   ,'64',2
                   ,......
                   ,'48',11
                   ,0
                   )
    
  • You place your order with a reports folder

    Hi all

    I have a problem in sequencing the name of reports, the present system automatically organizes the reports based on alphabetically as below

    A
    B
    C

    I want the order to be as below, is that possible? I want reports to be arranged according to our use.

    A
    C
    F
    B

    Please confirm if this is possible.

    Thank you
    Natraj

    Hi Ludovic,.

    Maybe you can just put a number before the name of reports to change the sequence:

    1A
    2 C
    3 F
    4 B

    I don't know of any other possibility.

    Best regards, Tim

  • You place your order on the Apple Site

    I ordered a 7 IPhone September 21, as it was very
    hard to get one at the store here in Rome, Italy
    at that time. Today, 7 October, I see that the IPhone is available to any
    store, but I have still not received my... and shipping follow-up shows that
    the phone is always located in Amsterdam, Holland. This means that it will be
    probably need another 7 days to be delivered to me! Now, I want to only disclose my
    concern that I think that what makes an online prescription should be advantaged
    otherwise it's not really a reason to buy
    an article on the Web Site!

    And this is the last time I'll do so!

    Thank you!

    Greetings from Rome

    !

    Don't know what your question on the iTunes Store, but you already know that you talk only to other users on these forums and that Apple are not here - if you want to contact Apple using the 'contact us' link at the bottom right of each page here.

  • You place your order of cross-directories

    Hello

    I need your help.

    I want to browse directories and order all the files by date.

    I used this command:

    cmd /c dir "c:\nuovacartella" / b/s A:-D / o:-d

    but the files are classified at the folder level.

    See the example:

    /C dir "c:\nuovacartella" C:\>cmd / b/s /A:-D / TC o:d

    c:\nuovacartella\cartella file\uno.txt

    c:\nuovacartella\cartella file\AAA\ciao.txt

    c:\nuovacartella\cartella file\AAA\due.doc

    c:\nuovacartella\cartella file\AAA\tre.xsl

    c:\nuovacartella\cartella file\AAA\appenaCreato.rar

    c:\nuovacartella\cartella file\BBB\B2\son a file.txt

    file Link\son a c:\nuovacartella\cartella

    c:\nuovacartella\cartella Link\uno

    c:\nuovacartella\cartella Link\appenaCreato

    c:\nuovacartella\cartella Link\ciao

    /C dir "c:\nuovacartella" C:\>cmd / b/s /A:-D / TC o:-d

    c:\nuovacartella\cartella file\uno.txt

    c:\nuovacartella\cartella file\AAA\appenaCreato.rar

    c:\nuovacartella\cartella file\AAA\tre.xsl

    c:\nuovacartella\cartella file\AAA\due.doc

    c:\nuovacartella\cartella file\AAA\ciao.txt

    c:\nuovacartella\cartella file\BBB\B2\son a file.txt

    c:\nuovacartella\cartella Link\ciao

    c:\nuovacartella\cartella Link\appenaCreato

    c:\nuovacartella\cartella Link\uno

    file Link\son a c:\nuovacartella\cartella

    but I want the files classified into cross-folder.

    Is it possible to do so (for example, using a batch script)?

    Thanks in advance. Leonardo

    Hi Leon,

    Thanks for posting your question in the Microsoft Community!

    I suggest you to ask your question on the MSDN Forums.

    http://social.msdn.Microsoft.com/forums/en-us/categories

    Hope this hslps.

  • You place your order by comparing - SQL Experts pls help

    Hi all

    I want to measure the closest points according to the percentage between these points and order.
    in other words, I want to show the relationship between the points according to the percentage value.
     
    drop table temp_value; 
    create table temp_value(id number(10),location varchar2(20), percentage number(9)); 
    
    
    insert into temp_value values  (1,'LOC 1,2',30); 
    insert into  temp_value values (2,'LOC 1,3',0); 
    insert into  temp_value values (3,'LOC 1,4',0); 
    insert into  temp_value values (4,'LOC 1,5',0); 
    insert into  temp_value values (5,'LOC 1,6',50); 
    insert into  temp_value values (6,'LOC 2,3',0); 
    insert into  temp_value  values(7,'LOC 2,4',0); 
    insert into  temp_value values (9,'LOC 2,5',0); 
    insert into  temp_value values (10,'LOC 2,6',10); 
    insert into  temp_value values (11,'LOC 3,4',90); 
    insert into  temp_value values (12,'LOC 3,5',80); 
    insert into  temp_value values (13,'LOC 4,5',0); 
    insert into  temp_value values (14,'LOC 4,6',0); 
    insert into  temp_value values (15,'LOC 5,6',0); 
    I want the output like this, the ranking of the point like this
     
    4 
    3 
    5 
    6 
    1 
    2 
    or like this
      6 
    1 
    2 
    4 
    3 
    5 
    If you ask me why I say this ranking only
     
    
    4    [90 percent between point 3,4 that mean can be 3,4 or 4,3] 
    3 
    5    [80 percent between 3,5 that mean can be 5 after 3,4] 
    6    [50 percent between 1,6 that mean can be 1,6 or 6,1 ] 
    1 
    2    [ 30 percent between 1,2 that mean can be 1,2 or 2,1] 
    concerning

    Published by: Isabelle October 6, 2012 10:18

    Published by: Isabelle October 6, 2012 10:43

    Published by: Isabelle October 6, 2012 20:04
    SQL> select loc
      2  from(
      3  select loc,rownum rn
      4  from(
      5  select percentage,location,regexp_substr(location,'\d+',1,rn) loc
      6  from temp_value a,
      7       (select 1 rn from dual union all
      8        select 2 from dual ) b
      9  order by percentage desc,to_number(regexp_substr(location,'\d+',1,rn)) asc
     10  ))
     11  group by loc
     12  order by min(rn);
    
    LOC
    --------------------
    3
    4
    5
    1
    6
    2
    
    6 rows selected.
    
  • You place your order for dashboards

    Hello world

    I want to sort the dashboard at the top of the screen. For now, they are sorted in alphabetical order, but I want to sort by a custom order. I know that I can put a number in front of it, but I don't like the idea of having numbers on the dashboard menu. In the past, I thought I was able to put spaces "" in front of a dashboard I wanted to ordered first, but for some reason, I can't it works again.

    Is it possible to order dashboards without putting the numbers in the names?

    Thank you!

    -Joe

    Vidal method would be the way to go if you want numbers. Don't know why the 'method of space' does not work.

    http://oraclebizint.WordPress.com/2008/04/02/Oracle-BI-EE-101332-changing-sort-order-of-dashboards/

  • You place your order with the text and integers

    One of the fields I need displayed is called ProductValue. According to the distributors of the product, the ProductValue can be an integer or text. I want the resulting table in order by value if it can be converted in its entirety, or alphabetically if he is unable. Currently I

    Select *.
    table t1
    where table1. Product = 'box '.
    Order by cast (table1. ProductValue as int)

    This query works fine, but when I change "box" for "paint."
    It causes an error "invalid number."

    with no brake the table looks like

    Product | ProductValue
    -----------------------
    box | 11111
    box | 22222
    Paint | Blue
    Paint | Red
    Paint | Green

    The question is how can I order it by value if ProductValue can be converted to integer, or alphabetically if he is unable.

    Published by: user10785638 on January 12, 2009 11:31

    Thanks for pointing it out, Centinul.

    Perhaps something like that for 10g and later, should do--

    test@ORA10G>
    test@ORA10G> @ver1
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    
    1 row selected.
    
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> with t as (
      2    select 'box' product, '000001111100000' productvalue from dual union all
      3    select 'box', '22222'   from dual union all
      4    select 'box', '11111'   from dual union all
      5    select 'paint', 'blue'  from dual union all
      6    select 'paint', 'red'   from dual union all
      7    select 'paint', 'green' from dual)
      8  --
      9  select product,
     10         productvalue
     11    from t
     12  order by to_number(regexp_replace(productvalue,'\D')),
     13           regexp_replace(productvalue,'\d');
    
    PRODUCT PRODUCTVALUE
    ------- ---------------
    box     11111
    box     22222
    box     000001111100000
    paint   blue
    paint   green
    paint   red
    
    6 rows selected.
    
    test@ORA10G>
    test@ORA10G>
    

    isotope

  • You place your order of Vista recovery disc

    Hello

    Have a Pavilion DV9000 (Service Tag: DV9824CA).  I lost my HD... need to replace.  Unfortunately, I didn't create the recovery discs when HD was alive (stupid me).

    I ordered the Kit of recovery Vista Home Premium 32B dual language at HP ($45).  The package came with only 1 DVD.  It is clearly stated on the DVD (1 of 2).  During the installation of the first DVD... He injects and asks for DVD #2... surprise, surprise... after many calls with HP support, they insist that this is a single DVD.

    Am I missing something here?

    Thank you!

    FYI... received a letter of apology from HP and 2 recovery DVDs Vista.

  • You place your order for recovery disc for mini 110

    Hello world

    first of all, I say this isn't really a laptop, I have a mini 110-3610sa.

    I've upgraded to windows 7 Professional to windows 7 basic, whatever he was going well until I stopped

    I lost the HP quick web and also the restoration of the factory, it goes to the windows recovery.

    can help you, I would really like to have fast web back it was very good and I was getting just configured with e-mails and fav sites.

    any help

    Ron tinydamed

    You can order recovery disks by following the instructions in the link below

    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?objectID=c00810334

  • You place your order and updates

    HI, I would ask it is possible for me to order here online and have it shipped here in the Philippines? If so, would I be able to get updates? Intend to buy the razr maxx hd in the future

    * Motorcycle shops here still does not sell the razr maxx. Thought about buying from ebay but the maxx HD came.

    Thank you. Nice day.


  • You place your order of media 64 bit for Vista

    I have a copy of Windows Vista 32-bit, but I need now support 64-bit. I can't find anywhere on the Microsoft site where to apply to. The card provided in the area is reference to www.windowsvista.com/1033/ordermedia, but it takes you just for the generic marketing of Windows Vista site. It is still available, and if so someone can give me a link to order the media? Thank you.

    Hello

    Microsoft used to have 64 bit for vista32 bits edition only shipping cost detail

    It was the link

    http://www.Microsoft.com/windowsvista/1033/ordermedia/default.mspx

    It seems that it is discontinued that microsoft is passed to windows 7

  • you place your order for WCS with MSE

    When ordering WCS with MSE, is that all that you need for WCS?

    WCS-STANDARD-K9 ($0) + WCS-MORE-500 ($44. 5 K)

    In the past, we ordered WCS-APLOC-500. WCS-PLUS-500 replace it?

    When you are not using MSE is WCS-APBASE-500?

    Yes, you just need standard + more to integrate with MSE. Plus also gives you high availability which is a nice feature. Most replaced Loc.

    Link below will give you all the information you need.

    http://www.Cisco.com/en/us/prod/collateral/wireless/ps5755/ps6301/ps6305/product_data_sheet0900aecd804b4646.html

    And the Base MSE/WIPS/HA.

    See you soon

    Carpet

  • You place your order of SNS-3415

    I ordered the SNS-3415 as ISE 1.1.4.

    I thought I have to install the ISE, however, it has been installed.

    but I don't know what is the ID/PW...

    No one knows about it?

    Hello

    You'll have to reimage, on a new installation, you should be presented with invites it installation.

    Tarik Admani
    * Please note the useful messages *.

  • You place your order of behavior in subclasses of Test

    The behavior of command between hereditary test classes seems to have changed between FlexUnit 4 and 4.1 beta 2.

    Here is the order in which my test methods are running:

    Subclass [After (order = 9)]

    Subclass [After (order = 10)]

    BaseClass [After (order = 1)]

    4.0 did:

    BaseClass [After (order = 1)]

    Subclass [After (order = 9)]

    Subclass [After (order = 10)]

    I think that the old behavior is correct... maybe a bug here?

    Thank you

    Brian

    Yes, you are right and I also discovered this morning. I have a potential problem I look now and it will grow up to my branch today.

    I can get an early version to test against and ensure absolutely that what forwards RC1

    Mike

Maybe you are looking for

  • first time using flash in private browsing content opens the non-private

    I already asked this question (using firefox, 20 at the time) about 1 year. I leave a link to this thread for reference https://support.mozilla.org/pt-PT/questions/955788#answer-425110. 2 computers (a desktop and a computer laptop operating system: w

  • Impossible to install a search plugin

    OS X 10.8.5, Firefox 24.5.0 1. click on the drop-down menu in the Firefox search box. 2. a list of installed search engine plugins appears with "Manage search engines...". ». Click on this button. 3. click on «Get more search engines» 4. https://addo

  • Wanted M6-AE151DX: wireless network disconnecting after rest

    I lose my connection Wireless to my home network if my PC is idle for a period of time. I have to disconnect and then back to the network access. No idea what is the cause and how to fix?

  • Process model: additional results

    Hello I have again to TestStand (process templates) framework. I would like to set up the process for my project template include comments of step and stage requirements for each step of the sequence. I've seen solutions where sequence recalls were u

  • Is posible use el mismo Subvi Clone en UN mismo Diagrama de Barr?

    One of the Sub - VI that he created lo utilizo en varios del become blocked, donde kinds information referring a ese diagrama of blocking. Para el mismo Subvi lo como he defined prealloue using clone re-entrant execution, esta forma, referring inform