Need help with query to sort the Digital Alpha channels.

Hello
I have data like A2-1 A2-2 A2-3 A2-4 A4-S 10 - A2 A2-22 A5 - 15 16 A5 A5-1 has A5-1 b
I want the data in a sequence sorted as A2-1 A2-2 A2 - 3 4 - A2 A2 10 A2-22 S A4 A5-1 has A5-1B A5-15 A5-16

How to get there. Help, please.

Perhaps that would help you

with data as
    (
       select 'A2-1' LOCATION_DESC  from dual union all
       select 'A2-2'  as col1 from dual union all
       select 'A2-3'  as col1 from dual union all
       select 'A2-4'  as col1 from dual union all
       select 'A4-S'  as col1 from dual union all
       select 'A2-10' as col1 from dual union all
       select 'A2-22' as col1 from dual union all
      select 'A5-15' as col1 from dual union all
      select 'A5-16' as col1 from dual union all
      select 'A5-1A' as col1 from dual union all
      select 'A5-1B' as col1 from dual
  )
SELECT * FROM data
order by SUBSTR(LOCATION_DESC,2,INSTR(LOCATION_DESC,'-')-2);

* 009 *.

Tags: Database

Similar Questions

  • Need help with query SQL Inline views + Group

    Hello gurus,

    I would really appreciate your time and effort on this application. I have the following data set.

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 20.00 *---19
    1234567 11223 - 05/07/2008 - 44345563 -a--10,00---19 ofbad quality adjustment
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19

    Please ignore '-' added for clarity

    I'm writing a paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, aggregate query Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Type, Invoice_Number, Vendor_Number. When there are no more records I want to display the respective Description.

    The query should return the following data set

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 10.00 *---19
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19
    Here's my query. I'm a little lost.

    Select b., A.sequence_id, A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    de)
    Select sequence_id, check_number, check_date, invoice_number, sum (paid_amount) sum, vendor_number
    of the INVOICE
    Sequence_id group check_date, check_number, invoice_number, vendor_number
    ) A, B OF INVOICE
    where A.sequence_id = B.sequence_id


    Thank you
    Nick

    It seems that this is a duplicate thread - correct me if I am wrong in this case->

    Need help with query SQL Inline views + Group

    Kind regards.

    LOULOU.

  • Need help with query Cumulative difference

    Hi all

    I need help with a query and my requirement is as below

    {code}

    ROWNOORDERSVALUE

    110900
    211700
    312500
    413400

    {/ code}

    I have need to query which will display the cumulative difference for example I value tell 10000 numbers opening

    now I need for each of the lines of cumulative difference

    {code}

    ROWNO ORDERS DIFF

    1 10 10000 - 900 = 9100

    2 11 9100 - 700 = 8400

    3 12 8400 - 500 = 7900

    4 13 7900 - 400 = 7500

    {/ code}

    WITH commands LIKE (10 SELECT order_id, 900 double UNION ALL val
    11. SELECT, 700 FROM dual UNION ALL
    SELECT 12, 500 FROM dual UNION ALL
    Select 13, 400 double)

    SELECT row_number() over (ORDER BY order_id ASC) AS rowno
    order_id
    sum (val) 10000 - OVER (ORDER BY order_id ASC) AS diff
    orders

    /

    HTH

  • Need help with query between 2 dates

    Hello

    I did not SEE in a long time and need help with a simple query.

    I have a table of DB access with 3 fields, name, date and number

    What I want is to create a query to retrieve all the names between 2 dates

    When I ask the date field, the results are showing in this formats 2013-07-12 00:00:00

    Here's my query

    < cfquery datasource = 'mydb' name = 'test' >

    SELECT name from myTable

    where edate between ' 2011-01-01 00:00:00 ' AND ' 2013-01-01 00:00:00 '

    < / cfquery >

    < cfoutput query = 'test' >

    #name #.

    < / cfoutput >

    What I get is this error

    ODBC = 22005 (assignment error) error code

    [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    Don't know what I'm doing wrong here.

    Please let me know.

    Thank you

    SELECT ename

    FROM MyTable

    WHERE edate BETWEEN

    AND

    #ename #.

  • Hello, I need help with my photoshop, rececently the majority of my family disappeared merger options and I cant access AVC and other options ive tried reset preferences and it seems to come back but when I add an image and try add text again

    Hello, I need help with my photoshop, the majority of my family rececently disappeared options fusion and I can't access strokes and other options ive tried to reset the settings of preference and he seems to come back but when I add an image and you try to add text again, they'll only options I have are drop shadow , gradient, Chromakey, shine of satin overlay, inner (I use photoshop cc 2015) Please help, my Skype contact options are: RoblivionM8 and email:[email protected]

    Thanks for your time

    Your first screenshot shows the layer style dialog where not all types of effects are indicated on the left. Bottom left of the dialog box, you see a small icon fx with a menu arrow drop-down. Use drop down the menu and make sure all you click on show all effects or restore the default list. I don't know what you're trying the shoe on the second screen capture.

  • No support for pse4, don't need help with aid and all the rest. What is a layer? How can I get help PDF from CD? I don't have any idea how to use it. I have a Macbook pro.

    Need help with using pse4 not taken in charge by adobe. How subjects do not available and I have never used something like that. Aide said there is a download but have not been able to do. What is a rookie to do? Y at - it somewhere that I can go to learn how to use PSE4?

    To find out how your problem:

    http://kb2.Adobe.com/CPS/402/kb402107.html

    To get help from the CD files you double-click in the finder, go to PDF help and drag it to the desktop or elsewhere.

  • Need help with instr/Regexp for the query

    Hi people of Oracle

    I use Oracle

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    I have a few responses from students and the valid values are + / / (alphabet) o/p and spaces at the end of the scam only not in the middle.

    According to my condition, the registration number 2 3.4 must be in the request but I'm alone (chart 3).

    Can we use REG_EXP

    Help, please.

    Thanks in advance.

    Rajesh

    with x as)
    (
    SELECT '+-+-POPPPPPP' STUDENT_RESPONSE, 1 numero_enregistrement FROM DUAL Union all the
    SELECT ' + --AOPPPPPP++' STUDENT_RESPONSE, 2 numero_enregistrement FROM DUAL Union all the
    SELECT "+-+-OPPPPPP -' STUDENT_RESPONSE, 3 numero_enregistrement FROM DUAL union all
    SELECT '+-+-9OPPPPPP' STUDENT_RESPONSE, 4 numero_enregistrement FROM DUAL)
    )
    (SELECT NUMERO_ENREGISTREMENT,
    TRIM (STUDENT_RESPONSE) X
    WHERE
    ((INSTR (UPPER (TRIM (STUDENT_RESPONSE)),'-') = 0))
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), '+') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), 'O') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), 'P') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)),' ')! = 0)
    )
    )

    Hi, Renon,

    Rb2000rb65 wrote:
    Hi people of Oracle

    I use Oracle

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    Thanks for posting this (and the WITH clause for sample data). It is very useful.

    I have a few responses from students and the valid values are + / / (alphabet) o/p and spaces at the end of the scam only not in the middle.

    You combine several qeustions responses in a single VARCHAR2 column? It would be better to have a separate line for each question.

    According to my condition, the registration number 2 3.4 must be in the request but I'm alone (chart 3).

    What exactly are your needs? You try to find the rows where the student_response contains one of the forbidden characters, or if it contains a space anywhere, but at the end of the string?

    Can we use REG_EXP

    Yes, but it's pretty easy and probably more effective, do not use regular expressions in this case:
    Here's one way:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     TRANSLATE ( UPPER ( RTRIM (student_response, ' '))
                , 'X+-OP'
                , 'X'
                )     IS NOT NULL
    ;
    

    In other words, once you remove the spaces and all occurrences of '+', '-', 'o' or 'P', then the forbidden characters are left, and you want to select the line, if there is one of these.

    If you really, really want to use a regular expression:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     REGEXP_LIKE ( RTRIM (student_response)
                  , '[^-+OP]'          -- or '[^+OP-]', but not '[^+-OP]'.  Discuss amongst yourselves
                  , 'i'
                  )
    ;
    

    but, again, it will be probably slower than the first solution, using TRANSLATE.

    Published by: Frank Kulash, October 17, 2011 13:05

    Published by: Frank Kulash, October 17, 2011 13:41
    What follows is a bit simpler that TRANSLATE:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     RTRIM ( UPPER ( RTRIM (student_response, ' '))
               , '+-OP'
               )          IS NOT NULL
    ;
    
  • Need help with query of queries

    I have the query 'almost' out there, but I don't know exactly how to proceed.

    I need all of the recrods meets the criteria of the query AppliedLicense.

    But not all records will have a match in the ApprovedLicense query.

    In the MergedData query I hope to have the column with date_exp filled with ApprovedLicense data when there is a football match but NULL if there is not a match.

    The code below, of course, only returns records where there is a match in the two data sources, but I have no idea how to proceed.

    Thanks for any help.

    You could do it yourself with functions of list if I hope, you do not have too many files. After executing the second query:


    You have now 2 lists of coordinates

    Subsequently during the processing of the first query,





  • Need help with query for points and polygons, 2 tables of

    Hi all

    I'm slowly stumbling along trying to figure things out space.

    I have two tables, GEO_POINTS:
    (
    DEP_ID NUMBER (12) NOT NULL,
    LINE NUMBER 4 NOT NULL,.
    MDSYS. POINT_LOC SDO_GEOMETRY
    )

    and POLYGON_AREAS:
    (
    POLY_NAME VARCHAR2 (120 CHAR),
    POLY_DESC VARCHAR2 (120 CHAR),
    MDSYS POLY_POINTS. SDO_GEOMETRY
    )

    Neither table is engraved in stone, if any, I can change some structure.

    I'm trying to understand how to write a query to retrieve all the points in a polygon, perhaps even with an optional buffer provided by the user.

    Conversely, I would probably also need to know what polygons a point would have drawn in, and it's the only request I could make any progress on.

    What I have so far, which is not working properly, is the following:

    Select * from deposits_search where dep_id in)
    SELECT dep_id
    OF geo_points, polygon_areas
    where (sdo_relate)
    poly_points,
    (SELECT point_loc
    OF geo_points
    WHERE dep_id = 10282444),
    ("mask = ANYINTERACT") = "TRUE");

    In the light of the foregoing, I want to select all the lines of a third table (DEPOSITS_SEARCH), for all polygons which is a point. The DEP_ID column is my primary key for most of the data tables in the database, and the number rose in my application query. However, the above returns all rows. It should only return one, because I only have a polygon of test defined so far.

    Any help is greatly appreciated. Thank you

    Bill Ferguson

    in which case you must include a line of buffer for the interaction between the points and polygons (with a stamp),

    better, you use the SDO_WITHIN_DISTANCE operator.

    http://download.Oracle.com/docs/HTML/B14255_01/sdo_operat.htm#i77653

    Not so sure what you mean with "I always have problems while providing a point location and extract the polygons that point would be plotted in" as so-called before unless you want that as a 'transitional instance of a geometry. (Specified using a variable binding or a builder SDO_GEOMETRY.) »

    http://download.Oracle.com/docs/HTML/B14255_01/sdo_operat.htm#i78531

    Read what geometry2 means in there. Read the examples and you will see that you have the geometry second in space operator as a builder. If this is what you need.

    Luke

  • Need help with query

    Have the rank as below,

    name of the sum

    100 A1

    -A2 200

    A3 300

    50 A1

    -A2 700

    A3 80

    10 A1

    -A2 90

    30 A3

    Need to query to extract the output like this:

    B1                     B2

    A1 + a3 (Sum) A2 (sum)

    Please help me out of this...

    Hello

    It is difficult to understand what you want... A guess based on many assumptions:

    -B1 and B2 are column headers,
    -"A1 + A3" and "A2" in the 'exit' is simply to indicate that you want the sum of the amounts for the first names.

    -Some of the AI have all their amounts > = 0, others have their amounts<=>
    -You want to make the sum of all positive numbers in the first column and all the negatives in the second column

    SELECT SUM (GREATEST (0, t.amount)) b1

    , B2 SUM (LESS (0, t.amount))

    MYTABLE t

    ;

    (I think there is only a bit of luck it's really what you want, but provide a full test case and the output that you really want and why not, try to explain / explicit rules, then we can give better help)

    Best regards

    Bruno Vroman.

  • need help with insert sitemap in the footer with the adobe site map muse

    Hi I need help, to know how to insert a site map link in the footer of a page Web in muse Adobe.

    a quick google search just shows how to create a site map, but no mention of how to get a clickable link to a sitemap on a Web footer.

    any help would be appreciated.

    Hello

    You can try to front page of the site hyperlink to any text that would open the sitemap on the mouse action.

    For example, domain.com/sitemap.xml, enter in this format in hyperlink with any text or image that you can place on the page footer area.

    Thank you

    Sanjit

  • 10-2101 U.S. Tablet HP: Need help with firmware mix to the top

    Little problem with the tablet in place lately and accidentally erased the firmware. My best look up and somehow able to reinstall one from here. But the thing is now the entire Tablet is in Chinese, because it seems I could have installed the wrong one... ghoulish pls help me fix it? Appreciate the help if ever...

    Hi@Robin Wendigo,

    Thank you for the HP's Support Forums. Best platform for all kinds of solutions, tips and settings for your questions/problems.

    For the best experience on HP forum, see our Guide to HP Forums to learn more.

    Problems of language on the tablet settings. Is this fair?

    I want to help you.

    Follow the steps from the link below and check if that helps.

    http://HP.care/2dyWVI3

    I hope this helps. Let me know to learn more

    Happy announcement.

    Resolv_S

    Happy to help you. I work for HP

    Please click on " ""Accept as Solution " " " if you feel my post solved your problem, it will help others find the solution.
    Click on the " Bravo Thumbs Up" " " to say 'Thank you' to help! "

  • I'm using a MAC with the current software. I am trying to download Adobe Flash Player. My password does not work. I ' v reset my password and restarted my computer. I need help with my password at the bottom of load.

    I'm on a MAC and my password does not work, I reset my password and I can not even download Adobe Flash Player.

    This password is presented by your operating system and is designed to prevent you from accidentally installing the software.

    If it comes to your personal computer and you don't need a password to connect to the computer when it first starts, you can probably leave the password blank and click OK to go to this prompt.  If it comes to your personal computer and your normal password does not work, make sure that CAPS LOCK SHIFT is off, and then type the password carefully.

    If this is your work machine and he asks an administrator password, well, you will need to have a conversation with your computer friendly.

    If you are still puzzled, you may need to reset the password on your Mac:

    http://support.Apple.com/kb/PH18653

    http://support.Apple.com/kb/PH14325

    http://support.Apple.com/en-us/HT201240

  • Need help with query outputing group names

    I'm trying to find a way for groups of output headers, then all the records in each group etc header. It would be easy, except there is a key with what I want to do.

    Normally, if I have this data set (that I've ' borrowed' a site that showed the closest to what I was looking for):

    Example table:

    TABLE [number]

    (Name, NUMBER)

    Dave Bower 843-444-4444

    Dave Bower 843-555-5555

    Matthew Small 843-111-1111

    Matthew Small _843-222-2222

    Matthew Small 843-333-3333

    I could use the following code:

    < cfoutput query = "somequery" group = "name" >

    #name # < br >

    < cfoutput >

    #phonenumber # < br >

    < / cfoutput >

    < hr >

    < / cfoutput >

    And get this:

    Dave Bower

    843-444-4444.

    843-555-5555.

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

    Matthew Small

    843-111-1111.

    843-222-2222.

    843-333-3333.

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

    BUT my actual tables are not set up like that. Rather than recording of every name of every record, I would have an ID that is the foreign key to another table.

    Current table set up is as follows:

    TABLE [people]

    (ID, NAME)

    1 Dave Bower

    2 small Matthew

    TABLE [Phones]

    (PEOPLE_ID NUMBER)

    1 843-444-4444

    1 843-555-5555

    2 843-111-1111

    2 843-222-2222

    2 843-333-3333

    If this output actually would this give me with my current setup and request above code:

    1

    843-444-4444.

    843-555-5555.

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

    2

    843-111-1111.

    843-222-2222.

    843-333-3333.

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

    How can I keep my current setup but create a query that produces the same result from the top? (The table names of people like the group headers, but data from the phones table under that output)

    You must gather the two tables, and then group the output.

    Something along the lines of the (may vary slightly depending on your DB and the exact table structure)

    SELECT ppl.name, ph.number

    PEOPLE ppl

    INNER JOIN phones ph ON ppl.id = ph.people_id

    ORDER BY ppl.name

    See you soon

    Kai

  • Need help with uploading photos to the new macbook

    I just bought a macbook pro 13 inch and had all my old files saved on a WD My Passport for Mac external hard drive. When try to import my library of photos from the external hard drive to the macbook, I receive a message reading "none of these files can be imported into your photo library.

    I read that you are unable to import the whole photo library to another library of photos, but I don't know if I understand that correctly. in any case, can someone please walk me through how to fix this problem, because a lot of these photos are very important to me. In case this is useful, I was able to import more pictures of the new photo library (such as those that have been saved on the desktop, iCloud etc.)

    Sorry, but unless you detail we can without help

    What format is the WD MyPassport? What you have on it (your library of Photos or just Photos)?

    You import photos - you open and migrate the library

    What version of the OS and the Photos or iPhoto do you have on your old system?

    LN

Maybe you are looking for