Sorting - numbers first and then the alphabets ?

Hi,
I have a list of names
starting with space, starting with numbers and some starting with upper case and then some starting with lower case letters.
The default order by sorts is - spaces, numbers, upper case alphabets and lower case alphabets.
But I want to order the names by spaces first, lower case alphabets, upper case alphabets and then the numbers.
How do i do this? Any help is appreciated.
thanks

Hi,
So you have 62 characters (10 digits, 26 capital letters and 26 small letters) that are now being sorted in one order, but you want them sorted in another order.
ORDER BY a TRANSLATEd version of the string:
SELECT     name
FROM     table_x
ORDER BY     TRANSLATE
     ( name
     , 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
     , '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
     );Notice that the 2nd argument to TRANSLATE has the 62 characters in the desired order.
The 3rd argument has the same 62 characters in the default sort order, that is, the order in which they will be sorted.
That is:
'a' will now be sorted as if it were '0', the very first of the 62
'b' will now be sorted as if it were '1', the second of the 62
'9' will now be sorted as if it were 'z', the last of the 62

Similar Messages

  • Every time i try to connect to firefox a message says the connection is untrusted, when i click get me out of here it goes to another firefox page and the it opens ok firefox opens as http first and then the second time it opens as https

    help every time i try to connect to firefox a message says the connection is untrusted, when i click get me out of here it goes to another firefox page and the it opens ok firefox opens as http first and then the second time it opens as https

    hello adzuki45, you already appear to run the latest version of firefox, so this shouldn't be a cause for concern, maybe your desktop shortcut is just misnamed).
    when there's a problem with installing flash, please see if it works with the full installer that is available at http://helpx.adobe.com/flash-player/kb/installation-problems-flash-player-windows.html#main-pars_header

  • Why does a blank sheet come out of the printer first and then the sheet to be printed? HP d135 printer.

    When I try to print from a web page using Firefox, the page usually does not print in the correct format and I always get extra blank pages. Usually the first page that comes out it blank. I'm using a HP d135 All-in-one printer. This problem does not happen when I use Explorer. Does anyone have a fix for this printing problem? Thanks for any help you can provide.
    == This happened ==
    Every time Firefox opened
    == I loaded Windows 7

    @paddyv, Welcome to the Community!
    You should have the option in the program you're printing from, to change the page order. Check the settings in the program.
    If you cannot find the options, please let me know which program and operating system you're running and I will have a look in to this for you.
    Best wishes
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • First the text and then the icon in JButton

    Hi,
    I want to create a button with a String followed by an icon. When I do
    JButton aButton = new JButton("Select", new MetalComboBoxIcon());
    It puts the icon first and then the string. I want to a create a button that looks like JComboBox.
    How would I do this?
    thx.

    setHorizontalTextPosition(SwingConstants.LEFT).
    Check out http://java.sun.com/j2se/1.3/docs/api/javax/swing/AbstractButton.html#setHorizontalTextPosition(int).
    Good luck,
    -- Scott

  • How to view folders with folders first and then files?

    I come from a Windows world but am loving the Mac world! But one thing I haven't been able to figure out is how to view folders with all the folders first and then the files? Right now, it sorts everything in alphabetical order, intermixing the folders and files. I like being able to see the folders sorted at the top and then the files. Is there a way to do this?

    If you want a more advanced browser, Pathfinder generally comes highly recommended.
    I'm not aware of a way to make folders sort on top. I generally detest that feature in Windows, because it messes up keyboard navigation. Both operating systems support jumping to a file by starting to type a name, but on Windows you don't know where you end up. If I have a file called "notes", I know that typing "N" will send me somewhere very close to the file, and a few arrow presses brings me to it - if I do it on a Mac. If I do it on Windows, it depends on what is selected - if it's a folder or nothing, I jump to the first folder beginning with N, but if it's a file, I jump to the first file beginning with N - in a completely different part of the list. I do use folder grouping in some windows on the Mac, though, by adding a space to the name. Ideally, it should be a per-window setting.

  • I want to reload original software in IMAC G4 - i have original disks, can i install OSX first and then load "software restore 1 to 6" and not load OS9

    I just purchased a used IMAC G4, cpu G4(1.1), powermac 4,2, 800MHz 15 inch FP and 55 Gig hard drive.  I now have 750 k memory and it is working fine.  i want to reload the original software.  i have all original disks -CDs. These include OSX Install; OS9 Install; Software Restore 1 to 6 CDs; Imac applications. 
    Question, please, is which CD do i load first?  Also i hope it is not necessary to load OS9.  I would think OSX install first and then the software restore disks and then the imac applications?
    Thanks.
    Robert.

    Boot from the disc labeled Disc One. Follow instructions and when you get to the part to select a Destination/Target drive click once on the drive then click on the Options button. Select the option for Erase and Install then click on the OK button and proceed.
    You do not have to install OS 9. If you don't then you simply cannot use the OS X Classic emulator.
    I believe there is a separate installer on Disc One for restoring pre-bundled software.

  • How do I import an existing cell number to SAMSUNG GUSTO 3 - Verizon Prepaid?  What number do I call?  Do I activate first and then request the import via the new Verizon (not wanted cell number)?

    The enclosed ACTIVATION & USE MANUAL is very limited.  It only tells you how to activate the phone after inputting a zip code.  On the web there are many contact numbers for customer service but ALL REQUIRE a Verizon cell number. 

    A friend I know had this issue and was told to activate the phone first and then call *611. You also can dial from any other phone this number 1 888 294 6804 and choose 1.  They both can handle the tranfer without any problem.

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • I get the following error everytime I download something from the internet:-"/Users/vinaypunjabi/Downloads/Ontario Colleges Chart(2)(1).pdf could not be opened, because an unknown error occurred.  Try saving to disk first and then opening the file".

    I get the following error everytime I download something from the internet:-"/Users/vinaypunjabi/Downloads/Ontario Colleges Chart(2)(1).pdf could not be opened, because an unknown error occurred.  Try saving to disk first and then opening the file".
    Then it shows as downloading failed.But if I click on it twice ,it opens up .
    this has started happening since last week.Before this ,it never happened.
    Please suggest what has gone wrong somewhere and how can I rectify it.

    Please install the following add-on to see if it helps.
    https://addons.mozilla.org/en-US/firefox/addon/pdfjs/

  • HT2128 Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Luis
    Good question - and one that a lot of (business) people would like solved!
    Your question prompted me to do some research, and I found this workaround posted by Scott Grossberg:
    His solution actually addresses a second problem too - how to attach a document when replying to an email message. In your case you may not need to consider the "reply" aspect - but if not right now, it'll come in useful someday!
    I've pasted it verbatim - if it works for you (it does for me) then all credit goes to Scott for solving the problem. There's just one thing I'd add to his solution: you will probably want to rename the message, as by default Goodreader gives it the Subject line: Mail with GoodReader attachments.
    THE GOODREADER OPTION
    1.  CREATE the document you want to send.
    2.  SAVE it to GoodReader (this will require you to buy and install the app).
    3.  Go to your email and OPEN the email thread to which you want to Reply and attach your file.
    4.  COMPOSE your Reply.
    5.  DOUBLE TAP the message.
    6.  TAP SELECT ALL. This will copy the entire email thread.
    7.  OPEN GOODREADER on the iPad and go to the file you want to send as part of your Reply.
    8.  At the bottom of the GoodReader screen you will see an EXPORT icon (it looks like a rectangle with an arrow pointing to the right).
    9.  TAP the Export button.
    10.  TAP EMAIL FILE. Depending on your needs, tap either SEND FILE “AS IS” or “FLATTEN ANNOTATIONS.” This will open a compose message screen with the chosen document already attached.
    11.  TAP in the body of the email screen. TAP PASTE. This will place your composed Reply and the prior email thread into the message.
    12.  ENTER the Recipients’ names in the TO: field of your message.
    13.  SEND your email Reply.
    The modified version (= when composing a new message rather than a reply):
    1 Make sure that the doc you want to attach is saved in GoodReader
    2 In the message you are composing, double tap, select all, and then copy.
    3 Open GoodReader and select the file you want to attach
    4 Select the export button at the bottom of screen
    5 Select e-mail file
    6 Position cursor in body of the email message, tap and paste. You may want to delete the "sent from GoodReader" text that precedes the attachment.
    7 Rename your message (as by default it will be Mail with GoodReader attachments)
    8 Add the recipient's address in the To field.
    Hope this helps! All thanks to Scott for this workaround.

  • When I download the digital copy of the Hunger Games, it stops at 4.0GB and first returns an error code -1309 and then the code -50. Please help me complete the download.

    When I download the digital copy of the Hunger Games, it stops at 4.0GB and first returns an error code -1309 and then the code -50. Please help me complete the download. I have tried removing the .tmp folder and downloading it again, but each time it stops the download in the same place.

    I discovered the solution. The external drive I was saving it to was formatted as FAT32. In that format, the largest files can only be 4GB, which explains why it kept stopping at 4GB. I backed up all the files then reformatted it as Mac OS Extended (Journaled), this is possible since I am on an iMac.

  • I would like to run the vi first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?

    i am running some vis in frames of sequence frome frame number 1 to frame 10.after this i would like to create one other vi with some strings and i want to save it to disk with a save button. i am opening,writing and closing the data.what i want is that a save button to write the file .moreover i would like to run the application first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?
    Attachments:
    savestrings.vi ‏80 KB

    Here's a picture of a while loop around part of your code. All it's doing is waiting to write until the user presses the save button. If you need it to do more, explain in more detail.
    Attachments:
    While_Loop.jpg ‏17 KB

  • I have Photoshop Elements 7.0 and when I go to sort the photos in order (from oldest date) I keep getting the message "Photoshop Elements 7.0 has stopped working" and then the program closes.  Sometimes, eventually it has sorted as I request but today thi

    I have Photoshop Elements 7.0 and when I go to sort the photos in order (from oldest date) I keep getting the message "Photoshop Elements 7.0 has stopped working" and then the program closes.  Sometimes, eventually it has sorted as I request but today this has been rejected over 15 times.  What is wrong?

    Try the licensing service update:
    http://helpx.adobe.com/creative-suite/kb/error-licensing-stopped-windows.html
    EDIT I see that maybe you did (is that the patch you mean? ); if so, try the other suggestions there.

  • Ios7 "Cannot Connect to iTunes Store". When I try clicking on the "Terms and Conditions" in iCloud, it first says "Cannot Connect" and then the following mes

    Hi, I have upgraded my iphone 4s to ios7 and now when I am trying to login to app store, it says "Cannot Connect to iTunes Store". When I try clicking on the "Terms and Conditions" in iCloud, it first says "Cannot Connect" and then the following message: "Verification Failed: the certificate for this server is invalid. you might be connecting to server that is pretending to be setup.icloud.com, which could put your confidential information at risk". My wifi is working properly as I have accessed websites from safari. I reset my network settings too and even reset my password. But none of these get my iphone working.

    I'm having the same problem with the iTunes Store...it much be down :(

  • Why is it, when I first launch Firefox, I click on a link I get a "sorry, Forbidden" page. I go back and then the link opens ok.

    Why is it, when I first launch Firefox, I click on a link I get a "Sorry, forbidden" page. I go back and then the link opens ok.

    I think once I did not even see the page in my history

Maybe you are looking for

  • Exception while running a test file as JUNIT test case

    Hi, I am trying to build a code using Eclipse to generate an "ear" file that can be used for deployment. The ear file is generated successfully but the build is not successful as the following exception is thrown while debugging a junit test case: ja

  • Calling abroad - Sorry this add on is not available

    Hi, For some very strange reason I am getting a strange message from EE when I have text 'CALL ABROAD' to 441. I am a Pay Monthly customer and I receive a message back saying "Sorry, this Add On is not available to Pay As You Go customers." However,

  • Errors not enough bandwidth...failed to respond

    Hi All. I am on my new shiny Macbook and great it is. But ichat..what a pain in the a.r.s.e. I have tried with a friend in NY and it took ages of him changing proxies disabling firewalls etc...on and on and on. Keep getting insufficient badwidth. I h

  • HiRes photos

    I have created photo pages using the conventional iPhoto / iWeb functionality. But my photos only load in low / med resolution when accessing the site. Can I provide an option for HiRes - large size - access to the photos?

  • Middleware - No BDOCS created for Initial Download

    Hi Middleware Gurus, I am facing a MW problem and don't have a clue as to why. So, can i please have your inputs. I am trying to download object - CUSTOMER_MAIN in R3AS in CRM after setting the necessary filters. In R3AM1 status is running and  there