GROUP BY on Alphabetical Order

Hi All,
I have a table like:
ACCOUNT_NAME AMOUNT
ABC 1000
BHJ 2000
CUJ 1500
ACB 500
AGH 1000
BHK 450
YUO 900
The result should be Grouped By ACCOUNT_NAME in Alphabetical Order like
ACCOUNT_NAME AMOUNT
ABC 1000
ACB 500
AGH 1000
2500
BHJ 2000
BHK 450
2450
CUJ 1500
1500
YUO 900
900
(-- Line is just for clarity)
I can use only SQL (this is a restriction).
Can this be achieved using SQL.
Regards,
Gaurav Srivastava

Hi Gaurav,
The following SQL will give you a running cumulative
total grouped by first letter of ACCOUNT_NAME:
select
account_name,
amount,
sum(amount) over (partition by substr(account_name,1,1) order by account_name)
from
your_table_name
Hope this helps.
Kailash.

Similar Messages

  • My alphabetical order in the music app is messed up. Is there a way to fix it?

    The songs are grouped by their first letter, but inside each letter it's like it starts the alphabetical order fine and after a random song it's start another alphabetical order from the beginning with other songs instead of sorting all the songs in that group in one alphabetical order.

    Your warranty is actually one year - the 90-days is only for free telephone support - but the warranty would not cover damage due to the iPad being dropped. I doubt there's anything you can do to fix the rocker, so you'll probably need to pay to get the iPad exchanged (by Apple) or repaired (by a third party repair service).
    Regards.

  • Alphabetical order of itunes

    Alphabetical order typically is organized numbers first, followed by A-Z. itunes organizes this way in all situations except when a number begins the name of an artist. How can I organize my artists alphabetically so that artists beginning with a number will come first then artists A-Z?
    For example: alphabetically the artist "311" should come before the artist "Abandones Pools" and I would like it to be this way. Right now, "311" shows up after the artist "Zero 7". However, the artist "M83" shows up before the artist "Mae". I want the number to come first alphabetically in all situations. How do I do that?

    "+Alphabetical order typically is organized numbers first, followed by A-Z+"
    There is no 'typical'. Different computer systems use differing character-sets that have letters first or numbers first. This can based on their ASCII numerical value or a customized sort program within the software.
    I do not believe that you can change the way iTunes internally sorts the data.
    You can, however, manage the 'Sort Artist' &/or 'Sort Album' fields for any song file (or group of files). You may have to be creative to get the numbers 'floating' to the top of the sort. i.e. - Putting a leading character such as a '.' in front of the numeric Artist or Album. Figure it out for yourself if it is truly important to you.
    Best of Luck

  • Make list of names in local variable list appear in alphabetical order?

    When you select a variable name from the drop down list of a local variable the list appears to be in chronological order. Is there any to make this list appear in alphabetical order?
    George

    Hi George:
    You said that local variables list appears in chronological order, but you wanted to appear in alphabetic order.
    You just need to set apropiate names and then use SetTabbingOrder
    You can use SetTabbingOrder to order all controls and indicators of your front panel, treating every control you see in the block diagram as one
    (A cluster is one of the controls you can order, but the elements inside the cluster must be ordered with ReorderControlsInCluster right-clicking the cluster)
    Returning. To SetTabbingOrder you have to click on VI's EDIT menu and select Set Tabbing Order.
    The front panel will turn it's color to somethin darker, and every control will be shown with a number.
    That number is it's tabbing index.
    At the beginning you see a 0 in the top, that means that if you click in a control, that control will become number 0, and then the number it the top will pass to be 1, so you can select the next control in order.
    If your first 23 elements are ordered, you don't need to click all 23, you can just set the top number to 23 and continue ordering.
    When you reorder an element, all elements before that remain the same, and the rest are added by one.
    When you are don, click on OK, or discard changes with x
    This SetTabbingOrder you can do with elements in your front panel, can be done with elements into a cluster and elements into a Tab Control. Only change de name (in clusters is "Reorder controls in cluster" and in Tabs is "Reorder controls in page"), but they work the same
    You might be interested in reordering in groups than reordering alphabetically?
    Hope it helps,
    Aitortxo.

  • Web Page Composer - Ordering Automatic lists in Alphabetical order

    Sorry if this is in the wrong place (newbie here)
    I'm trying to order an 'Automatic list' in Alphabetical order - based on page name/title
    So within WPC I have a folder with 10 or so web pages in them. and the next level up I have a page with the 'Dynamic Content' element.
    Within the 'Additional' field of the 'Dynamic Content' element I am able to 'orderBy=modified' or 'orderBy=created' but cannot seem to do what I would think is straightforward and order alphabetically by either name or title.
    Am I missing something simple and obvious?
    Or should I actually be trying to do this by modifying the XSL Template that controls the presentation?
    Thanks in advance for any help.

    Hi Alessio,
    have a look at at this thread:
    <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=599765">Link for your error message</a>
    Or maybe it is because your WPC isn't fully configured for anonymous access.
    To configure it for anonymous access, try this:
    1. Configuration in PCD - go to Content Administration -> Portal Content-> Portal Content -> Web Page Composer -> Container iViews -> WPC
    Default Containers. All of the iViews in this location should have the
    "anonymous" authentication scheme. The next location which should be
    checked is Content Administration -> Portal Content -> Portal Content ->Web Page Composer -> iView Templates. Again all of the iViews should
    have the "anonymous" authentication scheme. The same applies to all the
    templates which reside in Content Administration -> Portal Content ->
    Portal Content -> Web Page Composer -> Page Layout Templates. Finally
    check if all the pages which reside in Content Administration -> Portal
    Content -> Portal Content -> Web Page Composer -> Page Layouts have the
    "anonymous" authentication scheme.
    2. Configuration in KM - make sure that all the pages, which should be
    displayed to an anonymous user have in their permissions the Anonymous
    Users Group.
    3. Security zones - if you go to System Administration -> Permissions ->Security Zones -> com.sap.nw.wpc -> wpc -> no_safety and you open the
    permissions of this object, the Anonymous Users group must be added in
    the list.
    If all mentioned objects have their setting as described and you still
    experience problems (e.g. you see a browser dialog window for
    authentication), the reason most probably is, that the KM is not
    configured for anonymous access. A full description of the needed steps
    is provided with note 837898.
    I think the your error message could be solved with the first link.
    But afterwards you need to perform the steps mentioned above.
    Regards,
    Marcus

  • I have transferred my iTunes library from windows 7 pc to new windows 8 pc. Music was in alphabetical order by surname but new pc has some by surname some by first name and some not in alphabetical order. How can I get sorted?

    Question  Hi - I've transferred my iTunes library from windows 7 pc to one with windows 8. My library was in alphabetical order by surname but after transfer is now some by surname, some by first name, and some not in alphabetical order. How do I sort this out and also make sure that new downloads list by surname alphabetically?  

    Sorting in iTunes is often controlled by selecting different column headings. The sort order for any given column may be further modified by a sort value, e.g. Sort Artist affects the sort order of Artist. If you transferred the library properly all of the metadata should have remained intract and you simply need to select the a column that sorts as you want. If you had to import the library then there is the potential for tagging effects that could mean metadata entered previously didn't import with the media. Note that iTunes has no mechanism for automatically deciding which values are in <Forename> <Surname> order and could therefore be sorted as <Surname> <Forename>. The only automatic process drops leading articles (a/an/the) so that "The Doors" sort under D as "Doors".
    See also Grouping tracks into albums.
    tt2

  • How do I get my Music library songs in alphabetical order and not sorted by artist?

    Curious how you can sort your songs by alphabetical order without them being grouped by artist? Having this problem on ipad and iPhone

    Well as far as I can recall, I did nothing special at all when I synced my music to the iPad. I have very few downloaded/purchased songs on the device, but even the very few purchased songs that I have in the Music App are in alphabetical order. The only settings that can be changed on the iPad are in Settings>Music and I don't see anything in there that has any bearing in this. I have Group by Album Artist selected, but that doesn't change the alphabetical order if I toggle it off and on.

  • 80g Classic: Cover Flow Not In Alphabetical Order

    Actually, most of it is in alphabetical order. But I have an album by "Mandalay" that shows up last (yup, after the "Z" artists) when in cover flow. Also an album by "Ohgr" shows up twice, both with the complete set of songs (1st instance is correct alphabetically, but shows up a 2nd instance way towards the end in cover flow). Plus a couple other artists with the same "alphabetically-challenged" metadata. I've typed and re-typed every single meta-data and tags several times to no avail. I've even deleted them then put them back but the issue persists. Anyone have any idea?

    The albums that come up last are probably marked as compilations.
    See http://samsoft.org.uk/iTunes/grouping.asp
    tt2

  • How can I print a list of my Contacts in alphabetical order from my iMac

    I know how to change the alphabetical sequence of my contacts by first name & last name , but i would like to know how I can easily PRINT a list of my contacts in alphabetical order.
    I know how to print a list but the names are in random order.
    My question is what should I do so the printed list is in alphabetical order?
    Thank you

    I just found a way to print contacts in ABC order.  I signed in to my iCloud account online, then went to Contacts. I selected the contact group I wanted to print on the left page (example Xmas card list).  On the right page at the bottom, I clicked on the gear symbol and clicked "select all", then clicked again on "print". When the print window appeared, I saved the file to PDF, just to see if the information was in ABC.  It was!
    It's not perfect but it works... you can also do the entire list this way also... no choices as to what appears but it is a beginning...

  • ITunes 7.7 messes up alphabetical order

    Hello!
    After installing iTunes 7.7 any new import I make is put to the wrong place in the alphabetical order. I use "Album by Artist" sorting, and when I imported an Avril Lavigne album it was put to the letter L instead of A. Similarly Alice Cooper went to C instead of A.
    Trying to fix the issue I found the following:
    - If I simply sort by Artist, the problem persists
    - Even if I set the Artist to something completely different, like AC/DC, the album remains at the very same place. In fact, no matter what I do with the tags after importing, the songs won't budge an inch in the list.
    Has anyone else encountered something similar? Any ideas as to how to fix the sorting?

    Actually it wasn't enough to edit just one song's sorting info. I had to manually go through every song in the album and delete the sorting info to move the album. Is there a way to mass edit this?
    Not that I've found... as you said, the sorting options do not appear when you are editing track info for multiple items. I experimented with this in my own library and when I changed the sort info on one track it moved the entire album. I looked through preferences and didn't see an option related to it, nor when you right-click on a song. When you right click on a song there is an option to "Apply Sort Field" and then it gives you a second menu of different fields available. Not sure if this makes a difference or not, as I didn't have to click on this option in order to get my music to move around. My iTunes library is sorted by "Album by Artist" ... if yours is different, try switching to that and see if it moves automatically for you.
    Also, this never happened before 7.7. Is this a new function of iTunes 7.7 that it auto fills the sorting field with Last name, First name? Or could it be the Picard tagger I use to correctly tag the songs? (I am not entirely satisfied how iTunes tags the CDs I have so usually I grab the CDs to lossless AAC, run the tracks through Picard tagger and then add to the iTunes library.)
    I didn't do anything special with the tracks in iTunes. The only Sort Artist I see in my iTunes is for a band name that starts with "The" to make sure they are not all grouped in the T section. If it is just a first and last name, I have no sort information entered. Any CDs I have were imported into iTunes (on a different computer, later copied to the MacBook via hard drive). I've never changed track info on songs purchased from the iTunes store.
    Here's hoping this gets you somewhere...
    Let me know what you find, I'd be curious to find more information on how "sorting" really works in iTunes.
    CG

  • My drop down google searches used to be in alphabetical order now there in most used can i change it back to being in alphabetical?

    can i change my google searches back to being in alphabetical order rather than in most searched for?

    See:
    *http://groups.google.com/group/mozilla.dev.usability/browse_thread/thread/97a90936ae62e262?pli=1

  • Grouping songs in this order

    is it possible at all to group songs in order of artist, then by year each album was released? instead of artist, then albums in alphabetical order?
    for example, instead of:
    Van Halen -- 1984 -- 1984
    Van Halen -- Van Halen -- 1978
    The White Stripes -- Get Behind Me Satan -- 2005
    The White Stripes -- White Blood Cells -- 2001
    Im looking for
    Van Halen -- Van Halen --1978
    Van Halen -- 1984 -- 1984
    The White Stripes -- White Blood Cells -- 2001
    The White Stripes -- Get Behind Me Satan -- 2005

    ah, nevermind, found the answer thanks to SA Bill in another topic. Cheers!

  • List Videos in Alphabetical Order on iPhone 3GS?

    I am having trouble with my recently synced videos to my iPhone 3GS - I have synced across a bunch of audio and video files and when I browse the songs they are all listed in alphabetical order yet the videos appear to be in a random order. I have copied across 5 seasons of a show and the seasons aren't grouped together nor in alphabetical order. Is there anyway to group the seasons together or list them in alphabetical order?

    This seems to be a common problem after the upgrade to iOS 8 upgrade., for example: Re: Problems with events in Photo app on upgrading to iOS8
    There is nothing that can be done about it. Sorting of synced events  is not supported in the Photos.app.
    To speed up a bug fix send feedback to the Developers using this form: Apple - iPhoto - Feedback
    iTunes Photo sync will be discontinued soon. The iCloud Photo Library will replace it early next year in Photos for MacOS X. Already, with iCloud Photo Library Beta enabled, you can no longer sync your iPhoto library to your iOS devices using iTunes at all. 

  • Address book in alphabet order

    Hi
    Is it possible to put names and addresses in their groups in alphabet order?
    Ta George

    Not certain I understand you, but try this:
    1. Open AddressBook
    2. Go to "Preferences" and the "General" tab
    3. From the "sort by" drop down, select "Last Name".

  • How to get songs into alphabetical order (iPhone 4)

    Hi all, ive currently switched from a 3GS to an iPhone 4, but however my i click the Music app, and click 'Songs' tab, there is no alphabetical order? (Below in the picture) Its just done by ABC etc. But no in that little tab where on the right it shows the alphabet and for example you click 'M' and it takes you to your songs that start with 'M'.
    From this:
    To this:
    So how do i get it to display with alphabetical and with the tab where you can click a letter and it takes you to songs starting with that letter you choose?

    Hey peter2009,
    You may want to manually input the metadata for the songs. To do so, highlight the songs that you would like to group in an album > Right-click > Get Info (Be careful, you only want to edit the Album information).
    For more information, see the following resource:
    iTunes 11 for Windows: Edit song and CD information
    http://support.apple.com/kb/PH12360
    Thanks,
    Matt M.

Maybe you are looking for