According to numerical order (ORDER BY)"

I'm working on creating reports in Microsoft SSRS using a source Oracle database and the query. I'm trying to figure out how to order the following output in numerical order in Oracle.

"0" - 3 days 4-8 days, 9-13 days, 14-18 days, 19-23 days, 24-28 days, "> 28 days."

You can try using DECODE like this:

ORDER BY DECODE
         ( '0 - 3 Days', 1
         , '4 - 8 Days', 2
         , '9 - 13 Days', 3
         , '14 - 18 Days', 4
         , '19 - 23 Days', 5
         , '24 - 28 Days', 6
         , '> 28 Days', 7
         )

Even though I believe THAT DECODE is a concept of Oracle. I don't know if it would work in your environment. If this isn't the case, you can try one of the below CASE equivalents.

Published by: Centinul on February 15, 2013 12:34

Tags: Database

Similar Questions

  • CS6 Pantone libraries are not in numerical order

    In fact, they are random. For example, when you create a Duotone, I click in the color area, and I give myself a list of Pantone colors in this library. If I click on the arrow to the top it gives me seven colors at once. A reasonable person woud assume that the seven colors shown would be replaced by seven colors according to the numerical order. For example, if 250 to 256 colors are shown, click on the up arrow should produce colors 257 at 263. This isn't. Here's what I got on each subsequent click when starting 2562:7436, 517, 250, 7646, 243. These six numbers have no connection to each other. Selecting a color in these libraries is quite simply at random. You have to keep clicking on until the island of color you want just happens to appear. The numbers aren't even going generally upwards or downwards in general. They are random. What is the problem to Adobe? How alphbetize or put numbers in order a skill is taught in primary school. Is there anyway to make the colors come in order? If so, why is random by default?

    Thank you

    MHBrown

    The Pantone color chart and color books are in the exact order that Pantone gives them to us, which is in the exact order in which they appear in the printed Pantone books (which we check prior to shipping).

    If you want a specific number, just type this number to go to it.

    And Yes, has Pantone inserted more recent numbers and in the middle of the old books of Pantone swatches to create the latest Pantone books.

    If the numbers will not be in order.

  • When I include photos from a folder in the Photos app in the dock, and I have created an album for them, their changes. It is important for me to keep them in the same order that they were in the file. (It's a numerical order). Any solution?

    Recently, I switched from PC to Mac, and I transferred all my files photo. Now I am their integration in the Photos app in the dock (by dragging the file etc). But when I include photos from a folder in the Photos app in the dock, and then create an album for them, their order in the album change of what it is in the file. It is important for me to keep them in the same order that they were in the file. (In the file it is in numerical order). Any solution?

    You can drag and drop to any order in your albums.

  • Sort in numerical order

    can someone show me how this sort in numerical order?

    only the first column in the order, but the rest of the columns follow the sorted values.

    who is?

    Try this.

  • List of files in numerical order after the first two digits

    I have scanned documents on a usb key & saved as pdf files using a 8-digit date.  When I go to open the files, they are only in the order for the 2 first digits.  How can I get adobe to put in order using all 8 digits so that they are listed in chronological order, including the day and year?

    Adobe not in numeric order question.png

    The operating system will not sort by date like this. If you look at, it IS the 'digitally' sort 'dates' are in numerical order from the smallest to the largest.
    What I'm doing to sort by date is to use this format "YYYYMMDD".

  • Entity Collection is displayed according to the order of the parent Instance

    Hello

    I'm looking for help with behavior strange screen, which the cause proved to be elusive.
    < H4 > problem in brief: < / h4 >

    A collection entity screen appeared in the Web determinations according to the order in which the instances of an entity were concluded on a collection screen previous entity.

    -Entity 1: Members of the family (the person). Instances of the entity 1 are grouped into two categories using the inferred relationships: parents and children.
    -> Entity 2: reason for care (the reason for care). This entity is contained in entity 1 and has a key attribute, the end date.
    < h4 > Details: < / h4 >

    I think I've narrowed the cause to a rule that calculates the date the oldest end among the reasons for care. The rule is specific to the parents onlycare reasons. There is no rule that sum through, reduce overall, increase the through, etc., all members of the family. A colleague and I checked carefully the rules and I can almost guarantee that all rules have been written about 'check' only parents.

    I call this a 'strange' behavior because it depends on the order in which instances of family members enrolled on the entity collection screen. If the child is entered first, the screen pops up asking why the child for care (this should not happen because the reason for the child in care should not affect the rules). If the parent is first entered, the reasons-for-care appears to parents (as it should) and then does not the child (which is correct). The behavior is so wrong when the child is entered first.
    < h4 > anthropomorphic interpretation: < / h4 >

    It of almost as if the rule engine does not take into account, or somehow does not, the fact that it requires not just any what reason (s) for the care of the child - at least until it has at least one instance in reason of the entity of care.
    < h4 > example: < / h4 >

    Take a family of 2: Mary (mother) and Billy (the child). I took screenshots to illustrate how patterns of the first date of the end modules.

    Before entering the grounds of care (seem the same any instance of family member first entered): http://imgur.com/a/xk0Rt#uqGLx
    -The conclusion to the Summit is specific to Mary, but down, we see that it seems to check for reasons of care for two members of the family (indicated by the arrow).

    When the instance of the child is entered first, and a reason to care are entered for the child (employability program), the first end date is still unknown: http://imgur.com/a/xk0Rt#1nvKT

    When the parent instance is entered first, and a reason for care are entered for the parent, the first date of end is known: http://imgur.com/a/xk0Rt#P0WZw

    Rule: http://i.imgur.com/2wQkU.png

    * * *

    I know this is a difficult question and I tried to provide enough information without going overboard. Any help will be greatly appreciated.

    Thank you
    -Patrick

    This problem is resolved in the version of the OPA, which is currently being developed, should come out next year.

    Davin.

  • Bridge do not show images in numerical order

    I'm in Bridge CS3.  Off a full record of 108 images, all are in numerical order, with the exception of 6 that are out of sequence.  I double and triple checked my file names were all uniform except for the numbers.  What is happening here, so someone can enlighten us?  I have attached a screenshot showing the items 002-007 out of sequence.

    Depending on your screenshot, the Filter panel shows sorting by Date of creation. If

    you change this (click on the name or the small triangles to show the)

    submenu with this option) to sort by file name (you can choose between)

    ascending and descending with the other arrow), it will display the good

    order. There is also more to choose sort orders

    What is happening here, so someone can enlighten us?

  • The most easy way to batch rename identification labels according to the order in ascending order?

    Well, since the managers of these companies have their greedy heads their asses as usual, we can not control our MP3 file name and are limited to ordering only using identification tags.

    I have a book audio mp3 "Title" ID tag entries are not in a sequence in the growing alphanumeric order, so the order is completely f | _ | cked when I load it on my video.

    I have two applications that can modify the package ID tags: MP3Tag and the sponsor.  I want to change the 'Title' tag for a series of increasingly more simple (i.e. the of first file "title" tag will be changed to "01", the second file "Title" tag will be changed to '02', etc.), so that my stupid Clip will play files in order that he would play them if it was designed intelligently.  It's a real puzzle about how to proceed.  Can anyone tell me, link me to an explanation or simply give me the necessary script?

    Thank you

    Edit: stupid POS won't let you even curse, and even less to order your files in an intelligent manner... a managerial class who absolutely brainless we have some amazing that the socioeconomic conditions are in the shape they are in


  • Split according to quantity ordered total line

    Hi all

    I want to divide the row based on the quantity ordered.

    I have this request now coming online below.

    Select oel.ordered_quantity, oel.option_number, OEL.line_id, OHL. ORDER_NUMBER, OHL.order_number |'-'| ' 0' || OEL. LINE_NUMBER

    || DECODE (oel.shipment_number,

    NULL, NULL,

    '0' || OEL.shipment_number |' 00000')

    || DECODE (oel.option_number, null, '1', oel.option_number)

    OE_ORDER_LINES_ALL OEL line_shipment_option_number, OE_ORDER_HEADERS_ALL OHL

    WHERE

    OEL. HEADER_ID = OHL. HEADER_ID

    - AND OHL. HEADER_ID = ' 2028 "

    and OEL. LINE_ID-= 33679

    in (select substr (substr (attribut1, instr (attribut1,'|)))) ((((', 1, 2), 9), 3) from po_lines_all where attribute1 is not null)

    and rownum < = (select sum (oe.ordered_quantity) of OE OE_ORDER_LINES_ALL, OH OE_ORDER_HEADERS_ALL

    -connect by front < = (select sum (oe.ordered_quantity) of OE OE_ORDER_LINES_ALL, OH OE_ORDER_HEADERS_ALL

    WHERE

    OE. HEADER_ID IS OH. HEADER_ID

    and oh .header_id = ohl.header_id

    OH.header_id group, OE.header_id)

    and ohl.org_id = 82

    order of ohl.order_number;

    out put:

    Quantity ordered

    233682 10001125 10001125 - 0101000001

    1 2 33848 10001151 10001151 - 0101000002

    1 6 33850 10001151 10001151 - 0101000006

    5 10 33852 10001151 10001151 - 01010000010

    1 4 33849 10001151 10001151 - 0101000004

    1 8 33851 10001151 10001151 - 0101000008

    1 2 33869 10001154 10001154 - 0101000002

    1 4 33870 10001154 10001154 - 0101000004

    1 11 34522 10001157 10001157 - 01010000011

    134504 10001157 10001157 - 0101000001

    but in the output above, we see that the order quantity is 6. So for 6 registration should be

    1

    2

    3

    4

    5

    6

    Can you please help me find it.

    Kind regards

    Mani

    This give a try.

    Note: The Code is not tested. If no syntax or semantic error fix and run again.

    Select ordered_quantity

    option_number

    line_id

    order_number

    order_number

    || '-'

    || '0'

    || line_number

    || Decode (shipment_number, null, null, ' 0' | shipment_number |) (' 00000')

    || Decode (option_number, null, ' 1', option_number) + line_shipment_option_number (level 1)

    de)

    Select oel.ordered_quantity

    oel.option_number

    oel.line_id

    ohl.order_number

    oel.shipment_number

    of oe_order_lines_all oel

    oe_order_headers_all ohl

    where oel.header_id = ohl.header_id

    and oel.line_id in

    (

    Select substr (substr (attribute1, instr(attribute1,'||',1,2), 9), 3).

    of po_lines_all

    where attribute1 is not null

    )

    and rownum<>

    (

    Select sum (oe.ordered_quantity)

    from: oe_order_lines_all oe

    , oe_order_headers_all oh

    where oe.header_id = oh.header_id

    and oh .header_id = ohl.header_id

    Group

    by oh.header_id, oe.header_id

    )

    and ohl.org_id = 82

    Order

    by ohl.order_number;

    )

    connect

    by level<=>

    and order_number = order_number prior

    and line_id = line_id prior

    and prior sys_guid() is not null;

  • When importing my CF, I noticed that they photos are not in numerical order.

    How can I avoid this in the first place or mount post import?

    In fact, it seems that the erratic order was only on the preview.  When the import is complete, they were in the correct order.  Sorry for the confusion... and my ignorance.

  • Numerical order pending

    I bought an upgrade to my CS5 Extended (for Extended CS6) so that I can use it now instead of my old version of CS5, I went to the downloads section on my adobe but it says pending. Why is this happening? Thank you very much!

    Just in case anyone has this issue or problem; I was able to download two hours or more after I bought it. My orders, said it is still "order processing" but I managed to download it.

  • When I open a file in bridge my files no longer in numerical order and appear to be scrambled in exposure values

    When I open my files in bridge with CC, the images are more in digital but jumbled order in what appears to be exposure values. When I use the CS5 software files are fine, what should exclude a hard drive problem. It is a constant problem with all hard drives on CC and is accurate on these hard drives same with CS5. Any ideas on how to solve this problem?

    Look under the view menu > sort and see what is checked. I have Crescent and manually both checked.

    Let me know how it goes.

    Gene

  • Alphabetic or numeric order for items option?

    I am trying to create a view of 360 for a product, but when I import more than 1 image at a time I give myself the question where in the library, the files will be in alphabetical order but items are in an almost random order. This is causing issues in the creation of a 360 view due to not being in the right order. I have 100 images that must be imported, and I don't want to import each image one at a time for each product. Is there something that can be done if I can get all the items in good condition importer as in the library?

    adobe help01.png

    I reported this bug and it will be corrected in the next version. For this one, you are out of luck and have to move layers manually. If you had access to a version 2, you can load your images in there, save and re - open in version 3.0.

  • How to customize the order of music files in the folder (no not with artist, album, #, genre or classification tabs)

    I'm trying to transfer a playlist from Itunes on a folder, but I can't understand how to keep the order of the songs as I had them in the Itunes playlist.  I can't get files .mp3 alphabetically for the artist, album or genre.  Or according to numerical order by track number # or rating.  Any help in this regard would be highly appreciated.

    Here's how to change the default template for a folder: http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html.  Default behavior is to select the model based on the first type of file placed in the folder (you must choose something).  Vista sets the folder type template according to what are the types of files in the window and the settings display window Explorer. This will show how to reset the display settings for the Windows File Explorer, disable Automatic folder Type Discovery (which is I think what you want)and increase the folder display the cache to make Vista do not forget the display settings, the folder type template, the size or the position of a specific window for when it was still closed to the location of specific path.

    It does not work with the Sub record under, Open with, open in a new tab (Internet Explorer), etc... dialog windows of type through the good File menu bar item. These don't seem to be able to have their size or their position to recall. For the latter, you can use the free program http://autosizer.en.softonic.com/ to resize them.

    Here is another article on how to modify the columns in Windows Explorer and sort in Vista: http://www.vistax64.com/tutorials/108665-column-customize.html.  This will show you how Add, Remove, move, change the widthand change the sort order of the columns in Windows Explorer in the way that you want.

    Here is another article on how to change the display of the default folders in Vista (but she argues, it is not a perfect solution and can revert to the previous behavior is not as good as the two prior links provided: http://news.cnet.com/8301-13880_3-10019957-68.html.)

    I hope this helps with your situation - it may take more than one item to come up with the solution - but I would start with paragraph 3.

    Good luck!

    Lorien - MCSA/MCSE/network + / A +.

  • Burning a cd picture with photos in the right order

    I'm trying to burn a cd of photos using Windows Live Photo Gallery. I have no problem with the actual combustion, however they do not come out in the order I want what they. The record, that I choose to burn is in the right order by date, time, name, but one burned time and I play on my dvd player, they are not in the right order. How can I fix this?
    Thank you.

    I followed the instructions in the link you provided. Double checked them and they will be all renamed starting with the first image file Name.jpg according to numerical order, the 2nd picture of the group is the name of (1) .jpg file, 3rd picture is the name of the file (2) .jpg and so on. These were numbered automatically, but first of all, I made sure that they were displayed in the order that I wanted them. I have clicked on and highlight the first photo, press and hold the SHIFT key pressed, clicked on the last image in the file, once all selected / highlighted, right click on an image, choose 'RENAME', typed in the name of the file, press ENTER. The first image of thought would be (1), but was just .jpg and then all the other images were numbered. Have not had time to read everything in the directions of operation Panasonic Blu - ray, but see nothing on playback in random order for still images.

    =====================================
    If you are dialing as my example you will have better results.

    And no.... don't right click on 'everything' photo... the 'first' photo is
    one you want to right click on.

    If rename you batch and use the following number on the
    first file... the sequence should follow correctly when you press
    Come in...

    (10001) .jpg (you can enter a group name and a space
    before the number if you wish) summer vacation (10001) .jpg
    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

Maybe you are looking for