Order in characters not numbers

Hello
I need help with an order of data as below:
select distinct First_Name
from Name
First_Name
12345 Test
25825 Apple
14782 Bob
1452 James
I have to be able to just characters ascending classification
not the numbers but the numbers are included in the value of the field.
select distinct First_Name
from Name
order by First_Name asc
should display this
25825 Apple
14782 Bob
1452 James
12345 Test
but he will order to primes
1452 James
12345 Test
14782 Bob
25825 Apple
Y at - it no logic so that the characters order by ascending order
and the numbers are ignored when you perform the order in?
The number will not always be a length of 5 or 3, it varies.

Thanks for reading!

Hello

You can ORDER WITH a copy of a name that has all the numbers removed, like this:

SELECT    first_name
FROM       name
GROUP BY  first_name
ORDER BY  LTRIM ( TRANSLATE ( first_name
                             , 'A0123456789'
                   , 'A'
                   )
          )
;

LTRIM removes all space that can occur at the beginning of the string after that the numbers are deleted. Spaces that occur elsewhere are not affected.

I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.

Published by: Frank Kulash, June 16, 2011 10:37
If you can not do SELECT DISTINCT, then ARRESTED BY something that is not in the SELECT clause, use GROUP BY instead of SELECT DISTINCT.

Tags: Database

Similar Questions

  • My work buy Adobe Acrobat Standard XI a few years ago.  My computer crashed and I need to re - install.  I do not have a disk, order number and serial numbers.  How do I do that?

    My work buy Adobe Acrobat Standard XI a few years ago.  My computer crashed and I need to re - install.  I do not have a disk, order number and serial numbers.  How do I do that?

    Hi, Roxane,.

    You can download Acrobat Standard 11 of: https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html

    and use purchased serial number to activate the software.

    Kind regards
    Rave

  • Removes all characters except numbers

    Hi all

    I want to reformat to following phone numbers. As you can see it in what follows, I want to delete all characters except numbers and it does not start wirh 0 0 at the beginning of the f-number. And the length is 11. What do you recommend?

    (543) 456-35-50 = > 05434563550

    (555) 555-55-55 = > 05555555555

    (210) 111-11 / 11 = > 02101111111

    Thank you

    Hello

    3018678 wrote:

    Hi all

    I want to reformat to following phone numbers. As you can see it in what follows, I want to delete all characters except numbers and it does not start wirh 0 0 at the beginning of the f-number. And the length is 11. What do you recommend?

    (543) 456-35-50-online 05434563550

    (555) 555-55-55-online 05555555555

    111-11 / 11 (210)-online 02101111111

    Thank you

    To remove all characters except the 10 digits, you can use REGEXP_REPLACE

    REGEXP_REPLACE (str, '\D')

    To put a "0" at the beginning of the string (if it isn't already begin with a '0'), you can use REGEXP_REPLACE even once:

    REGEXP_REPLACE (REGEXP_REPLACE (str, '\D')

    , '^([^0])'

    , "0\1".

    )

    I don't think that there is a way to do both things wih a single integrated function call.

    There is a requirement on the length being 11?  What happens if that comes into conflict with one of the other requirements?  For example, if the string is already long of 11 characters, but does not begin with a '0', do you want to add a "0", which makes 12 characters?  What happens if the length, after removing the numbers no, is very small, say 1?  (You can use LPAD adds however many ' 0 s you need.)  If the length (after removing the numbers) is 12 or more?  What happens if the string does not contain any what numbers at all?

    If these things are questions, then post CREATE TABLE and INSERT statements for some examples of data, accurate results, you want that data, and explanations.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • On a PC using Windows and Adobe Reader, I sent 10 PDF files in a zip file and each label of the PDF file with a number from 1 to 10, so that they appear in the order I want. Numbered 1 to 9 records fell in sequence automatically, but number 10

    This is my first time using this forum. I hope that my question made its appearance and that this space is to respond to the answers possible, but just in case, here's my question again:

    On a PC using Windows and Adobe Reader, I sent 10 PDF files in a zip file and each label of the PDF file with a number from 1 to 10, so that they appear in the order I want. Numbered 1 to 9 records fell in the sequence automatically, but the number 10 appears under the number 1 instead of below the number 9. I googled the problem, do not see addressed. I called Microsoft, and they said it's a matter of Adobe. If anyone can help I would be grateful.

    Thank you.

    Not an Adobe issue at all. If you want your files to a single digit (1-9) to appear before the 10, you must add a zero at the beginning.

    01

    02

    03

    04

    05

    06

    07

    08

    09

    10

  • Lightroom - can I import RAW files, re - order, then change the numbering of the original RAW file?

    Lightroom - can I import RAW files, re - order, then change the numbering of the original RAW file?

    I used two different cameras and several memory cards to shoot a recent wedding. Unfortunately, time of the camera were a different time, so the time of capture does not correctly order them. Obviously neither does the name of the file...

    Thank you

    Natalie

    Yes, after you use Lightroom to correct the capture time in the files themselves, in the library the library module > rename Photo allows you to rebuild all the filenames selected from scratch. Just customize the preset file name. Use the chips here, you can set up a change of name that begins with a numbering sequence (so that they appear in the order you want) and including the Date, hour, Minute, second in addition to other chips or custom text to add to each file name.

  • The songs in its library of music must be listed in alphabetical order by song, not by the artist.

    I recently downloaded 10 IOS.  When I go to my music library, so I could go to playlists, artists, albums, or songs.  Given that my artists are listed in alphabetical order, is it not superfluous to enumerate my songs in alphabetical order of the artist?  I prefer my songs alphabetically by song title as it used to be.

    Hey fosterdogmom,

    I understand that you do not want to see your songs in alphabetical order by title to the music as opposed to them being sorted by artist app. I can help you with that.

    To change this, go in settings > music and look for a setting called sorting songs and Albums and choose to sort by title. Take a look at the following link for more details on this.

    Library - iPhone
    http://help.Apple.com/iPhone/10/#/iphbddea0e5e

    Take it easy

  • Characters not visible (caused by hitting the bar space or TAB in PL/SQL developer tool) causing slow running query? and database with low performance?

    Hi all

    I need your help to get this issue resolved its urgent and I'm not able to get to the conclusion. Here is my scenario, I'm getting slow query runs because of some non-visible characters that are copied with the application of the PL/SQL developer tool. Please find below attached screenshot: Oracle_Issue

    Oracle_Isssue.png

    Note: This non-visible characters are caused when we write the query then us hit the SPACEBAR or press TAB PL/SQL developer tool

    I use the developer tool PL/SQL to write or test the query. Now I take this request copy paste in my application of the company (who takes this query connects to Oracle or any source of data base, catch data and produce PDF reports for customers).

    Now, my client is the Oracle user when I write and you run this query by the PL/SQL Developer, it works fine, but when I paste in my Inbox feature request (reporting system) and run it, it runs slower and jams to the customer database. Now after a little research I found that when I copy the query directly from PL/SQL developer at my request, he copy some characters not visible (introduced when we press SPACE or TAB in PL/SQL developer tool when writing query) with the request, then I copy this query again to my box of the application Notepad and delete these non-visible characters. Now, after removing the non-visible characters again once I copy backup question in my application and run the query, it works normally. Please find below attached screenshot: Oracle_Issue 2

    Oracle_Isssue_2.png

    So I think that the cause of slow performance is due to some INVISIBLE CHARACTERS present in the query.

    My application uses SQL server 2008-2012 at the backend to store data from different sources.

    Character set used: SQL_Latin1_General_CP1_CI_AS


    To write and test queries: PL/SQL developer tool

    My Client use Oracle 11 g

    Character set used: Normal character: NLS_CHARACTER: AL16UTF16

    National Characeter: NLS_NCHAR_CHARACTER: WE8WIN1521

    I just wanted to know the blocking process to the top of the database and the characters not visible how affecting slow running query of query database.

    Please let me know if I'm missing something or you need more information on this issue.

    Thanks in advance,

    HP

    Simple answer. No.

    Spaces and line breaks do not change the execution plan created. Does not plan to run slower or faster.

  • print characters not...

    Stupid question:

    If you wish to print characters not (which by default are not... printable), is you it a font that would resume all of these visual or can pass only by capture d ' screen?

    Hello

    Marc Autret & Jongware already!  Great tool!

  • Muse - characters not supported

    When I'm trying to publish my site on BusinessCatalyst, I get this message on the muse:

    Error:

    Adobe Edge animate "/ users/joekaul/Dropbox/J-Col Design / Square / untitled folder/Square animation.oam ' cannot be exported to Adobe Business Catalyst because it contains a file (images/down # .jpg) named containing unsupported characters: / \ *? & "<>|:;" % # + ' ^ { } [ ] `

    As you can see, there are no characters not supported in the expansion... it is a lively edge of .oam file and has worked in the past. In fact, on my last successful upload that it worked. You can see here:

    TheSquare. BusinessCatalyst.com

    This is the place 'drawing' upper-left.

    Can someone enlighten me as to why this is happening? Thank you!!

    I would certainly find what is this file.

    The active panel will display a type checker icon small next to the image (I think) which indicates a property that is not properly sized.

  • decoding-best way to decode the characters to numbers using a conversion table

    I string input that contains mostly the numbers, but in the end there is the 2-character code which means a country, like "EE" for the Estonia, or 'LV' for the Latvia and so on, see example of input value:
    select '9999123456789012EE00' input, null output from dual;
    I want in the output column value where these 2 characters are decoded/replaced by numbers with the following algorithm:
    1. replace in the input string of characters 9999123456789012EE00 numbered 14 and 14 the output would be 9999123456789012141400.
    2. the 14 was especially the letter 'E', all the alphabet is encoded as follows:

    A = 10
    B = 11
    C = 12
    D = 13
    E = 14
    ..
    Y = 34
    Z = 35

    Thus, the '9999123456789012LV00' value must be converted to 9999123456789012213100 (L = 21, V = 31).

    What is the best way to achieve this decoding in sql/plsql?

    Published by: CharlesRoos on March 16, 2010 03:52

    Maybe

    SQL> with t as (
      select '9999123456789012LV00' input from dual
    )
    select input,
           regexp_replace (input,  '[[:alpha:]]+',
                           (ascii (regexp_substr (input, '[[:alpha:]]')) - 55) || (ascii (regexp_substr (input, '[[:alpha:]]',1,2)) - 55))output
    from t
    /
    INPUT                OUTPUT
    -------------------- ------------------------------
    9999123456789012LV00 9999123456789012213100
    1 row selected.
    
  • After you add the Arabic language to my preferences, the numbers always appear in Roman numerals on everything except for microsoft office. How to do it so I can type in Arabic characters and numbers in all places, not just office?

    Already, I've added the Arabic language pack.
    He works in the office, just anywhere else.

    follow-up: I've created a KLC which actually works since Microsoft KLC does not work with the Arabic characters and Hindi digits on the same layout.

    I composed the automatic installer that microsoft allows you to make and downloaded on my website at: http://ryanglynn.com/2010/12/06/arabic-keyboard-layout-finished-programming/

    All the characters and Arabic numerals will work with win7 on this KLC. The installation is simple. Just open it and run the .exe

  • Is there a way to differentiate the string containing the characters and numbers?

    Hello, I created an application to read data from a serial port device. The problem is that the device, at startup, displays a block of text that contain characters describing the device. Shortly after, he displays a command prompt "command:" it's when I want my VI to enter the command to start to take action.

    I was looking at the VISA waiting on the event and looks that could be used to wait for the output device, only a "Serial character", but there is no distinction between the letters and numbers that I can tell.

    If the device is out of numbers in the reading string, of course, no need to enter the command to start to take action once again, which will probably only confuse the device. In this case, I want my VI to continue taking measures with VISA Read.

    The reason is that when I run the application, the device may have already been turned on. Send this command to the device using VISA Write is not necessary at this time.

    Any advice would be appreciated. Thank you.

    This makes it much easier.  In this case, this will do the trick.  You will notice that the bottom of the case does not match even if it has valid values inside.  The only thing that will match if the entire string is of the form XX. XXXX. Incidentally, since we are only matching numbers now, you can remove the "ignore case" Boolean as there is more important.

  • iPhone 7 pre-order credit cards not already changed

    IV ' e pre-ordered iPhone 7 more black on September 9, the date of delivery of the iPhone that it is supposed to be seven 20-22 seven but seven today 18, my credit card is still not Chargerd for order, it's strange, because the delivery time is 6-8 days, and the order is still in development.

    do you have any ideas about this?

    Maybe the local apple store stocks will be depart on delivery orders?

    I think you will find that they will not charge your card until just before it is delivered.

  • How to pre-order carrier free/unlocked iphone 7 more, pre order page his not giving an option for that.

    Hello. I wanted to buy an iphone 7 more factory unlocked. I'm going out of country next month so I have to use outside of US. I tried pre order but it is asking for my carrier, (I use Tmobile but I have to use this cell phone in another country) there is no option for iphone "carrier free/unlocked. How am I supposed to order free iphone carrier?

    7 iPhone more

    You will not have this option until Apple offers it. It should happen fast enough, but no specific timetable.

    Good luck

    GB

  • Link with characters not ASCII

    I'm trying to insert a link in the Pages v 5.6.2

    The link to insert is: https://es.wikipedia.org/wiki/Generaci on_y

    That is a perfectly valid link to a Wikipedia article (in Spanish), but it's URL contains a character not ascii (o)

    When entered at the prompt of link Pages supposed is a bad URL and let the link by default (www.apple.com) or the previously entered if you change a link.

    Is this expected behavior? This will prevent from many URL of wikipedia, not only Spanish, but many languages and also all the other pages that contains characters that are not ASCII, which are much like RESILIENCY now considers perfectly valid http://www.w3.org/International/articles/idn-and-iri/.

    I don't know where to post this, so I leave it here. We hope to see this fix.

    This is solved in the editor page links using substitution of encoding for the character of o as shown below. B3 C3 is the sequence of UTF-8 for this letter, and you discover that by launching the character palette (Edit menu: emoticons and symbols) and looking for the letter o. Latin lowercase letter o acute accent will be among the related characters, and when you click on this character, it will be apparent the UTF8 designation.

Maybe you are looking for

  • Drivers updated on Satellite A660 - 11 m

    Hello guys My first buy Toshiba and it looks nice, but I found problems that I don't know how to deal with them Toshiba Bulletin Board asking me to install the new drivers many times who I am 1 by 1 at the end when I download the drivers after their

  • Tick mark spacing

    I'm trying to figure out how to get the spacing in a chart xy of the graduations. I can't find in the properties. I'll put the max/min for the x / balance there by program and I want to thank scales scale max/min, a past my y max and max x values of

  • I accidentally deleted the funcion of the history navigation. How can I restor it

    How do I restore my shipping history function

  • Blues Ea6900 password

    I have a Linksys EA6900 wireless router, and I love it. However, once I put in place, I lost the paper I had written the password, and the only journal I have now has the original password and I can't even read my own writing for the router password!

  • Sony Bravia KDL55W800C

    BRAVIA KDL55W800C requires the software update for the dual display photo and recording via the USB port in Australia. The reference guide tells me that the update will be available in July 2015. Went to channels site several times and told me softwa