Quantities of string with County group

Hi all

its been a while that I'm stuck with this query, below is the sample data, I work with

table name: demo

Column1
zaqwsxqwa
zaqwsxfvb
zaqwsxdec
xswedcmja
xswedchnb

assuming that the above table, I need string manipulation in such a way that the output is

Output 1
zaqwsx1
zaqwsx2
zaqwsx3
xswedc1
xswedc2

is it possible to do it only with SQL?

Hello

829596 wrote:

Hi all

its been a while that I'm stuck with this query, below is the sample data, I work with

table name: demo

Column1
zaqwsxqwa
zaqwsxfvb
zaqwsxdec
xswedcmja
xswedchnb

assuming that the above table, I need string manipulation in such a way that the output is

Output 1
zaqwsx1
zaqwsx2
zaqwsx3
xswedc1
xswedc2

is it possible to do it only with SQL?

Sure.  In fact, there are different ways that give the same results on your examples of data, but for reasons of differetn, and that's why they all will give different results on other sets of data.

One of the many different ways is

SELECT SUBSTR (column1, 1, 6).

ROW_NUMBER () OVER (PARTITION OF SUBSTR (column1, 1, 6)

ORDER BY NULL

)

AS output1

FROM table_x

;

I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.
If you change the query at all, post your modified version.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: https://forums.oracle.com/message/9362002

Tags: Database

Similar Questions

  • How to convert the string with numbers in the table of Boolean 2D

    Hello

    I have input a string with comma separated numbers 1,192 (starting at 1).

    This string must be converted to a table 2D-boolean. Each number that appears should be true, not true rest.

    The 2D table consists of 4 times of 0.47 Boolean values.

    1.48--> [0.47] numbers [0]
    49.96--> [0.47] numbers [1]
    Numbers 97.144--> [0.47] [2]
    145.192--> [0.47] numbers [3]

    If a '1, 49, 97 145' input string put all [0] [0.3] true.

    How can it be easy/fast resolved?

    Thanks for help

    Break the string of numbers in a table of numbers.  (Spreasheet String to Array).

    In a loop For, index with each issue of this table.  Use in the range and Coerce to see if it is in the range of numbers.  (You can put this in a loop For as auto good indexing through the ranges).  If it's in the range, then use subset replace table to activate the corresponding item in a real.  If this is not the case, do nothing.  Maintain the table of Boolean in a shift register.

    Repeat this step for each number in your table.

    (What is a class assignment?)

  • How to convert the string with numbers in U8 with ascii

    Hello

    I have a string with only numbers 0. 9 paper.

    Now, I want to convert to table-U8.

    He works here, but now the problem: How can I change each character to its ascii value?

    Example:

    entry: 123 (string)

    output: x 31, x 32, x 33 (U8-array)

    Thanks for the help

    It's very easy

    String to Byte Array Function
    Have the Palette: string/array/path Conversion functions

    Converts a string to an array of unsigned bytes. Each byte in the array has the ASCII value of the character corresponding to the string.

  • Number of strings with decimal

    Hello community,

    I would like to convert numbers to the string with decimal separators. So if the number is 52351 then the string I need is 52 351

    Another example 18653284.9653235 becomes 18,653,284.9653235

    What would be the best way to do it?

    Thank you!

    Read this thread: https://forums.ni.com/t5/LabVIEW/comma-separator-for-large-numbers-how-to/m-p/2123090/highlight/true...

    Not the first person to wish for this idea.

  • How to concatenate the string with a digital command?

    Hello

    How to concatenate the string with a digital command?

    Thank you.

    I think I forgot to add the semicolon, what you can do is, drag the CONCATENATE function and add semicolon.

  • How the filter string with don't cares...?

    Hello

    I need help on getting filter string with cares. Attached is a VI for ref.

    If anyone has chain, analysis of expertise; I need your help.

    Thank you

    SB_LV

    Another fun one

  • Initialization of a string with a UTF-8 character

    It doesn't seem like it should be that hard, but I am trying to initialize a string with a UTF-8 character (specifically a degree after a few numbers symbol).

    I tried:

    Dim myString As String = new String ("\uc2b0", "UTF - 8");

    as well as a few permutations but did not have luck...

    Java strings are in Unicode, UTF - 8 is a way to represent these characters in a stream of bytes.

    Take a look at the following code, it might be useful: I suggest to put point break in the line add and take a look at the content of the two strings.

    No compiled code, could not work, I hope you get the idea...

    Char [] testchars = new char [] {'\u00B0', '\u0020'};
    String displayString = "undefined";
    Byte [] testBytes = new byte [] {(byte) (byte), 0xC2 0xB0, 0x20};
    String displayString2 = "no set2";
    try {}
    displayString = new String (testchars);
    displayString2 = new String(testBytes,"UTF-8");
    } catch (Exception e) {}
    }
    BasicEditField bef = new BasicEditField ("Test2:", displayString + ":" + displayString2);
    This.Add (BEF);

  • How to associate policies crypto with tunnel-group?

    Hi, when I review the configuration of the VPN from point to point, I have a question. The ASA has three peer-to-peer VPN configuration. So, there are also three groups of tunnel in there. My question is how each VPN to ensure encryption policy tunnel-group? In the anther Word, what encryption policy associated with tunnel-group? Thank you.

    This is the phase 1, they work from top to bottom.  When you try to negotiate the tunnel between two counterparts, in the background, they send all of your policies and according to which is first (from top to bottom) is used.

    For example.

    If your counterpart device uses (3des, md5, pre-shared key and group 2), it will not match the policy 1 and the rest of the policy will not be considered.

    Kind regards

    Sandra

  • ACS 5.2 assignment of authorization with nested groups in LDAP

    I have a Cisco Secure ACS 5.2 on a virtual machine. We use it for administrative access to our equipment Cisco GANYMEDE +. I use LDAP to authenticate with acitive directory. I currently run when a user is directly in the group that is assigned.  I change the way in which assign us group permissions and have created nested groups.

    For example:

    -User1 is a member of group1

    g -roup1 is a member of the "Group 2".

    I have card group2 to have access to my devices. However, User1 is not get mapped to the Group of law and access is denied.

    When I go to the monitoring, reporting and authentication GANYMEDE + details, under other attributes where it shows the outside groups the user is a member, I don't see group2, only group1.

    However when User1 is a member of group2 directly, the user is able to log on.

    GBA 5.2 not does support permissions allow this how to use nested groups?

    Mapping of nested groups is not supported by LDAP (because users containing that attribute memberOf groups just above them, are not nested). It is a behavior deafult when we use nested with LDAP groups. You must add subgroups for GBA and both respective authorization rules.

    Kind regards

    Jousset

    The rate of useful messages-

  • How to concatenate strings with the lines of a text file

    Hello
    I tried concatenate strings with the lines of a text file, but something is wrong with my code and I belive is the agruments I use in the cycle for. If anyone can help me I will appreciate it very much.
    My code is:
    [code]@echo off
    the value "input=C:\Users\123\Desktop\List.txt".
    for /f "usebackq tokens = *" % in (' input % ') do)
    the value 'str1 = C:\some directory\ ".
    the value ' str2 = %% ~ F '.
    the value "str3 = .pdf".
    the value "str4 = str1% str2% str3%.
    echo.%STR4%
    ) [/ code]
    and the text file is something like:
    121122 [code]
    122233
    123344
    124455 [/ code]
    But I get only one wrong answer and I have to run it like 3 times to get a real result and it is a mistake, the first two are empty spaces and gives the third one as the last line of the text file but repeated n times, where n is the number of lines in the text file.
    Result:
    [code] C:\Users\123\Desktop>concatenate.bat
    C:\Users\123\Desktop>concatenate.bat
    C:\Users\123\Desktop>concatenate.bat
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\Users\123\Desktop>[/code]
    So if anyone has an idea about what is wrong please let me know.
    Concerning
    -Victor-

    Hi Victor,

    This forum is dedicated to the support of the Office of consumer Windows (fonts, colors, personal settings).  Since your question is about programming and usually outside the context of most of the customers, I suggest you post your question in the forums as http://msdn.microsoft.com - the Microsoft network to users will be more adapted to help you in your quest.
  • How to capture the data of type string with agent script and then compared to an alarm

    Hello...

    How to capture the string with agent of script data and then create a rule to compare the string data to generate alarm?

    Thank you!...

    Start here:

    http://en.community.Dell.com/TechCenter/performance-monitoring/Foglight-administrators/w/Admins-wiki/6155.custom-script-agent-1-leverage-an-existing-monitoring-script-to-push-data-into-Foglight

  • Transform a shape layer with several groups/paths in another?

    Hello

    I'm trying to turn the form A B-shaped into aftereffects.

    shapes copy.jpg

    Both are drawn in illustrator, and I imported into aftereffects and diverted path to forms.

    At the moment I do a key framing color and the path in the sticky on the form A and form B. From there I will meet with two questions.

    (1) for now I have to manually open each group, every path, every feature of color until I'm able to keyframe them. After that I have to paste the keyframe of the track and keyframe colors individually to the corresponding group. It's doable, but I have to turn the form in 10 more other variants. Just want to check is there a shorter way to the key all the way to access and color properties frame. And then copy all of the keyframes from one form to the other.

    Screen Shot 2016-04-21 at 2.33.34 PM.png

    (2) I noticed that not all the points on the path are created equal. I think that the "starting point" is noted with an extra box compared to other points.

    Screen Shot 2016-04-21 at 2.47.02 PM.pngScreen Shot 2016-04-21 at 2.47.14 PM.png

    As the "starting point" of a path is different from the rest, the transition has become weirdshape.gif.
    Can I check if someone knows how to change the "starting point" to another point on the same path? Or y at - it another way of fixing?

    Finally, if there is more easy morphing shapes to another, I'll be happy to listen. Thanks a lot ~

    I would do this kind of thing differently and 90% of the work in Illustrator.

    I would like to begin by drawing a path in Illustrator, to duplicate the path and to change the size and position and change the color of the outline of the color I wanted for the inside of the first form at the beginning of the animation.

    I use then the gradient tool to create a blend between the two forms specifying the number of steps, so my first form duly filled out for one frame looked like this:

    I would then do the same for my second form by using different colors, so I got this:

    With the two mixtures on you will see this:

    The upper mixing layer is where your animation will start and the bottom is where your animation should end.

    The next step is to select Merge layers and spread the mixture, if you find yourself with two groups:

    Here comes the fun part. Select groups, and then specify the number of steps you want as long as the number of images that you want in your animation. In this case, I want a second 1 transition and my comp is 29.97 FPS, so I selected 30.

    Now spread the mixture:

    We should end up with a group at layer 1 with 30 subgroups:

    Ungroup the higher group only then deselect all layers and select a single layer, then choose release to layers (sequence).

    now select all sub layers in the layer panel and drag it above layer 1. Layer 1 is now empty, so you can delete:

    Save the file HAVE and import into AE as a model with the size of the layer keeps selected:

    [Open the model, select all layers, move the a CTI frame to the right by pressing Ctrl/Cmnd + arrow to the right, then press Alt/Option +] to set the out point of all layers and then the wizard from keyframe to the layers in sequence without overlapping:

    I usually go to the point of exit of the background layer and press N to set the work area exit point, then cut the comp to work area.

    This model is then nested in your main comp and you can activate the time-remapping, so you can change the speed and use CC force motion blur to smooth animation.

    You will find it much easier to create the morph to a shape layer in Illustrator those in AE, you don't need to convert anything to forms and most of the work is done for you before you start. Total time to create this project with about 1/4 of the time it took to create this post.

  • Power CLI script to add multiple VLANs with port group name in an ESX cluster

    Hi all

    Can someone help me get a script adds several VLANs with port group name in an ESX cluster?

    Kind regards

    Suresh

    OK, so you just need to do an Import-Csv inside the loop and change the variables accordingly.

    What is the provision of this CSV file?

  • VCloud direction to connect to Vcenter with 3 groups.

    Hi all

    We have a vcenter with 3 groups, we want to connect the vcloud Director to a single cluster where we have virtual distributed switch. We want to manage the other two clusters with vcenter. Is it possible to connect a single cluster in vcenter vcloud Director. Also is there any document allowing to learn about how vcloud Director will communicate with vcenter when connecting and after.

    Thanks in advance.

    Kind regards

    Vikram.

    Yes, it is possible.  When you create a 'provider' in vCloud Director... you select the Cluster that you want to use as resources gross calculation.  Then, when vCloud Director creates items in this provider, it will be only the cluster you had selected.

    The connection is via the SDK for the most part, on port TCP 443.  This is the same as the vSphere client installable.  If you are looking for our KB system there is a diagram of network for reference. (1030816 KB)

  • Search strings / with some applied condition

    Hello comrades,.

    I am writing an extendscript which is supposed to loop through all of the PGF and find all the strings / with a certain condition applied (say, comment).

    The problem is that in the script guide, I couldn't find a function that retrieves the status of character property. I tried to use the function "charAt() (i)" js, but it doesn't seem to work in ARE. No idea how to implement such a function?

    Here's the 1st draft of the script.

    var doc is app. ActiveDoc;

    If doc. {ObjectValid()}

    checkCondFMt (doc);

    }

    else {}

    Alert ("no open section");

    }

    function checkCondFMt (doc) {}

    FMP var is doc. MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

    var CondObj is doc. GetNamedObject ("Comment");

    While (FMP. {ObjectValid()})

    var textItems is bmp. GetText(Constants.FTI_String |) Constants.FTI_LineEnd);

    var b = new TextRange();

    TR. Beg.obj = tr.end.obj = textItems;

    TR. Beg.offset = 0;

    for (var i = 0; i < tr.len; i ++) {}

    var c = tr.charAt (i);

    var PgfProps is doc. GetTextVal c [i], Constants.FO_CondFmt;

    Alert (PgfProps.Name);

    }

    PGF = bmp. NextPgfInFlow;

    }

    }

    Thanks in advance for your comments!

    OK, I see the problem now. JavaScript doesn't have a "block scope" for its variables. She carried the function, so your 'i' variable is used in more than a loop. You must use a different variable for the inner loop:

    for (var j = 0; j < oCond.length; j += 1) {
        if (oCond[j].Name == CondObj.Name) {
            applyCharFmt(textRange, doc);
        }
    }
    

    In the code example above, I use 'j' for a counter for the inner loop.

    In general, you can avoid problems of this kind to declare all your variables at the top of the function:

    function functionName (param1, param2) {
    
        var i, j, textlist; // etc.
    
        // function code...
    }
    

    That makes it easier to 'follow' variables and make sure that you do not use one more than once.

    -Rick

Maybe you are looking for

  • Bounce output file names do not correspond to the name of the project

    It must be a common scenario. I started a project called "forgotten Garden" and saved the project. Later, I decided that I wanted my song to be called "Voice of the forest" instead. So I renamed my project (File-> management-> rename). When I made a

  • iPad2 request access code, but it won't take.  I know!

    He repeats to me 'Enter Code iPad requires your password after restart.  I know VERY well my password. She will not be taken.   It's been about a month or more that I used it, but still...  Any suggestions?

  • Laptop HP 2000-2A 00: Windows 7 Home Premium ISO download

    My hard windows crashed and I installed ubunto erased on my recovery. I have the OEM sticker on my laptop and I was wondering how to get a 7 ISO to reinstall windows. I tried several sites today, and nothing seems to work. I type in my OEM sticker an

  • Double and Int

  • Windows calls me on the phone?

    I get calls today saying that they come from Windows and try to help me because my computer keeps viruses and hackers are stop a few messages. / are you really calling me or is it a hoax? They asked me to go into my system and run these files. Hung u