Column with numbers filling

Hello

I want to fill a column with numbers from 1 to the end of the table. I need to create a function for him?


THX in advance

2890953 wrote:

Hello

I want to fill a column with numbers from 1 to the end of the table. I need to create a function for this?

THX in advance

What of it?

SQL > create table mytable

(

number of N1

number of n2

)

Table created.

SQL > insert into mytable (n1)

Select the level of + 1000 - number + 1000

of the double

connect by level<=>

10 rows created.

SQL > update mytable

the value of n2 = rownum

10 lines to date.

SQL > select * from myTable

N1 N2

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

1001 1

1002 2

1003 3

1004 4

5-1005

1006 6

1007 7

8 1008

1009 9

10 1010

10 selected lines.

Kind regards.

Alberto

Tags: Database

Similar Questions

  • How to fill a column with numbers and maintain when adding or deleting lines?

    So far, I've discovered two ways to fill a column with the number:

    1. Enter '1' in a single cell, '2' in the one below, select both, and then use the yellow dot to drag down - it will do the rest.

    2 create a formula such as 'A2 + 1' and drag also.

    However, in both cases it will work if I manually this continues to do for each newly added line at the bottom. Now, that alone would not be that big of a problem if it wasn't for the fact that I'm working with a table where the lines can be added among other rows in the future.

    Having said that, could someone please tell me how to create a column with a number that will increase automatically? I mean - if I add a new line between line 56 and 57, I want the new line to have a '57"in it, and the" old 57 "would now be"58"and so on." " I don't want to drag the whole column, which can be hundreds if not more than a thousand lines.

    Try to put this in the cells in the column:

    = ROW()

    In the formula, you can add or subtract a number if necessary to get the starting number that you need.

    SG

  • [8i &amp; 10g XE] How to compare a column with the text of a column with numbers

    This is probably a simple question, but I can't seem to find the answer. I tried variations on use to_number to_char and interpreters, all nothing will do.

    The real problem is that I have a table with a column of numbers in a database 8i (datatype = NUMBER (3)) and a column with the text (datatype = CHAR (3)), and I need to compare two values.

    This table has thousands of lines, but here's an example of the data in these two columns:
    TXT     CHR
    -----------
    001     1
    001     2
    002     2
    XXX     1
    003     3
    What I want to do is select the lines where the TXT and CHR VALUES do not match, then it would be (given my example):
    TXT     CHR
    -----------
    001     2
    XXX     1
    But, I'm having difficulties in comparing two columns, because they are not the same type of data.

    I tried to work on a simplified version of the problem in the 8i database both my 10g XE database:
    SELECT     *
    FROM     (
         SELECT     1.000               AS nbr
         ,     TO_CHAR(1.000,'000')     AS txt
         ,     CAST('001' AS CHAR(3))     AS chr
         FROM     dual
         )
    WHERE     txt = chr
    ;
    But this also returns any line, and it isn't even the "XXX" in the text column to treat in this example.

    Can someone help me understand what it is that I'm missing?

    Thank you!

    Hello

    user11033437 wrote:
    This is probably a simple question...

    Simple if you know the secret; maddening if you do not have.

    ... I tried to work on a simplified version of the problem in the 8i database both my 10g XE database:

    SELECT     *
    FROM     (
         SELECT     1.000               AS nbr
         ,     TO_CHAR(1.000,'000')     AS txt
         ,     CAST('001' AS CHAR(3))     AS chr
         FROM     dual
         )
    WHERE     txt = chr
    ;
    

    Try:

    TO_CHAR (1.000, 'FM000')
    

    By default, TO_CHAR leaves place the beginning of the string to a sign less, in which case he should ever one, TO_CHAR (1,000, '000') returns makes 4 characters, not 3. "FM" in the format said TO_CHAR do not add a space.

    If it does not, after the release of DUMP (txt) for the few lines that you can't match, so that we can see exactly what is in them.

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • Fill a column with Ajax in tabular form

    Hello

    I have the following problem.

    A tabular presentation, created with the wizard and not with apex_item, has a certain LOV column with different values and attributes of the element the following call:

    1 onChange = "javascript:f_getPV(#ROWNUM#,_this)";

    The column that needs to be filled has ID = f10

    2.
    function f_getPV (pRownum, pInput) {}
    get var = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is getPV', 0);
    get.addParam ('x 01', pInput.value);
    gReturn = get.get ();
    $("f10_000"+pRownum).text (gReturn); SPAN id
    }


    The application process (On Demand) looks like:

    3.
    declare
    lv_pv_sk number: = apex_application.g_x01;
    number of lv_cost_amt;
    Start
    Start
    Select dc.cost_amt
    in lv_cost_amt
    Since DC default_cost
    where 1 = 1
    and dc.power_value_sk = lv_pv_sk
    and dc.valid_till is null;

    exception
    When NO_DATA_FOUND then
    lv_cost_amt: = 0;
    When TOO_MANY_ROWS then
    lv_cost_amt: = 0;
    end;
    HTP. PRN (lv_cost_amt);
    end;

    Unfortunately, I don't have any population for the f10 ID column.

    Any ideas?

    Hello

    What HTML tag is than f10? If it is a box entry or text you cannot use jQuery text() function.
    Something like this might work then

    $s("f10_000"+pRownum, gReturn);
    

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

  • In DataGrid, how to fill a column with zeros (0) records?

    Is there a simple way, in a DataGrid, for fill the records in a column with zeros (0)?

    I have a DataGrid with two columns: colA and colB.  ColA records values from a RemoteObject call.  I need auto-fill (AutoFill) recordings in colB with zeros.  How is that possible?

    Thank you!

    If you need to 0 in the dataprovider, once pass you the loop of result of the data provider and add a dynamic property with value = 0;

    Something like that

    var dp:ArrayCollection = event.result as ArrayCollection collection;

    for (each var item: Object in PD)
    {
    item.demoValue = 0;
    }

    Create a new datagrid column, set demoValue as datafield.

    If it is just for display, add a new column, put an itemrenderer with label = '0 '.

  • Formula that multiplies the value in each cell in a column with another cell

    Hello

    is it possible to do a simple way?

    I need a formula that will multiply each cell in a column, one by one, with another cell. And then a way to fill the 32 raws and 12 columns.

    That's how I explain what I need simplified.

    G1 = ((chaque cellule de B1:B32, un par un) * E1) + (( B1:B32each cell, one by one) * E2) +...

    and then that again and again for coulumn 12.

    G1 to G12.

    G2 would be = ((chaque cellule de C1:C32, un par un) * E1) + ((each cell c1:C32, one by one) * E2) +... and so on...

    It would take weeks to do this manually.

    It is, for me, very complicated and my brain can not understand.

    very grateful for the help with this one.

    Thank you

    /Joakim

    Hello

    I can't imagine the structure of your table according to your descriptions, but formulas would be very simple if you calculate:

    G1 = (B1*E1 + B2*E1 + ... + B32*E1) + (B1*E2 + B2*E2 + ... + B32*E2) + ...
       = (B1 + B2 + ... + B32) * (E1 + E2 + ...)
    

    For example,.

    Table 1 (excerpt)
    
    A1 
    A2 
    A3 
    A4 
       
    B1  =RANDBETWEEN(0,5)
    B2  =RANDBETWEEN(0,5)
    B3  =RANDBETWEEN(0,5)
    B4  =RANDBETWEEN(0,5)
       
    C1  =RANDBETWEEN(0,5)
    C2  =RANDBETWEEN(0,5)
    C3  =RANDBETWEEN(0,5)
    C4  =RANDBETWEEN(0,5)
       
    D1 
    D2 
    D3 
    D4 
       
    E1  =RANDBETWEEN(0,5)
    E2  =RANDBETWEEN(0,5)
    E3  =RANDBETWEEN(0,5)
    E4  =RANDBETWEEN(0,5)
       
    F1 
    F2 
    F3 
    F4 
       
    G1  =SUM(B1:B32)*SUM(E)
    G2  =SUM(C1:C32)*SUM(E)
    G3 
    G4 
    

    * Table is designed with numbers v2.

    Kind regards

    H

  • I want to is a column of numbers in my spreadsheet Numbers.

    I want to is a column of numbers in my spreadsheet Numbers. I know that the method formula easier, but some of my cells contain 2 numbers (13 + 5 or 8-3). I could use some help in the setting up of a formula. Would appreciate any help or suggestions.

    Feeling a little stupid!


    < re-titled by host >

    You will have to manually clean the cells that contain expressions. Number reads these text and SUM() ignore them all simply.

    You can clean them in doing the calculations yourself and by replacing the phrase with the result of the calculation, or you can add an = sign before the first number in each of those cells, conversion of the expression of the text in a formula and let the numbers to do the calculations.

    Once you have all the cells showing numbers, you can use SUM() to determine the amount.

    After you spent all this trouble, it will be time to think about what you could change on your data entry to avoid having to do it all again in the future.

    Kind regards

    Barry

  • How to avoid duplicates on a column with condition

    Hi all

    I need some advice here. At work, we have an Oracle APEX application that allow the user to add new records with the decision of the increment automatic number based on the year and the group name.

    Said that if they add the first record, group name AA, for 2012, they get the decision number AA 1 2013 as their record casein displayed page of the report.

    The second record of AA in 2013 will be AA 2 2013.

    If we add about 20 records, it will be AA 20 2013.

    The first record for 2014 will be AA 1 2014.

    However, recently, we get a claim of the user on two files of the same name of group have the same number of the decision.

    When I looked in the history table and find that the time gap between 2 record is about 0.1 seconds.

    In addition, we have the correspondence table which allows the user admin update the sequence number start with the restraint that it must be greater than the maximum number of the current name of the current year.

    This boot sequence number and the name of the group is stored together in a table.

    And in some other case, the user can add a decision duplicate for related record number. (this is a new feature)

    The current logic of the procedure to add the new record on the application are

    _Get max record table with selected group name (decision_number) and the current year.

    _INSERT in the folder table the new record came with the decision to number + 1

    _ update sequence number of the number of the decision just added.

    So instead of utitlising the process of editing the built-in automatic table of the APEX, I write a procedure that combine all three processes.

    I have run some loop for continually perform this procedure, and it seems that it can generate autotically new decision unique number with time about 0.1 second difference.

    However, when I increase the number of entry to 200 and let two users run 100 each.

    If the time gap is about 0.01 second, double decision numbers are displayed.

    What can I do to prevent duplicate?

    I can't just apply a unique constraint here for three columns with condition because it can be duplicated in some special conditions. I don't know much about the use of lock and its impact.

    This is the content of my procedure

    create or replace

    PROCEDURE add_new_case)

    -ID just use the trigger

    p_case_title IN varchar2,

    p_year IN varchar2,

    p_group_name IN VARCHAR2,

    -decisionnumber here

    p_case_file_number IN VARCHAR2,

    -active

    p_user in VARCHAR2

    )

    AS

    NUMBER default_value;

    caseCount NUMBER;

    seqNumber NUMBER;

    previousDecisionNumber NUMBER;

    BEGIN

    -execution immediate q '[alter session set nls_date_format = "dd/mm/yyyy"]';

    SELECT count (*)

    IN caseCount

    OF CASE_RECORD

    WHERE GROUP_ABBR = p_group_name

    AND to_number (to_char (create_date, "yyyy")) = to_number (to_char (date_utils.get_current_date, "yyyy"));

    SELECT max (decision_number)

    IN previousDecisionNumber

    OF CASE_RECORD

    WHERE GROUP_ABBR = p_group_name

    AND to_number (to_char (create_date, "yyyy")) = to_number (to_char (date_utils.get_current_date, "yyyy"));

    IF p_group_name IS NULL

    THEN seqNumber: = 0;

    ON THE OTHER

    SELECT Seq_number INTO seqNumber FROM GROUP_LOOKUP WHERE ABBREVIATION = p_group_name;

    END IF;

    IF caseCount > 0 THEN

    default_value: largest = (seqNumber, previousdecisionnumber) + 1;

    ON THE OTHER

    default_value: = 1;

    END IF;

    INSERT INTO CASE_RECORD (case_title, decision_year, GROUP_ABBR, decision_number, case_file_number, active_yn, created_by, create_date)

    VALUES (p_case_title, p_year, p_group_name, default_value, p_case_file_number, 'Y', p_user, sysdate);

    -Need to update the sequence here also

    UPDATE GROUP_LOOKUP

    SET SEQ_NUMBER = default_value

    WHERE the ABBREVIATION = p_group_name;

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    Logger.Error (p_message_text = > SQLERRM)

    , p_message_code = > SQLCODE

    , p_stack_trace = > dbms_utility.format_error_backtrace

    );

    LIFT;

    END;

    Many thanks in advance,

    Ann

    It's easier to solve for the case, while p_group_name is not null. In this case, you update a GROUP_LOOKUP line, so that you can select to update this line at the beginning, to prevent cases of two for the same group added at the same time. To do this, change the selection of GROUP_LOOKUP to:

    SELECT Seq_number INTO seqNumber FROM GROUP_LOOKUP WHERE ABBREVIATION = p_group_name for an updated VERSION OF the SEQ_NUMBER;

    and move this to be the first thing that did the procedure - before it has CASE_RECORD lines.

    In the case when p_group_name is set to null, you have some object to be locked. I think the best you can do is to lock the entire table GROUP_LOOKUP:

    the table lock in exclusive mode GROUP_LOOKUP wait 100;

    The '100 expectation' means that he will wait until 100 seconds before giving up and trigger an error. in practice, that is expected to only wait a moment.

    Exclusive mode allows others to read, but not to update the table.

    UPDATES and the LOCK of the TABLE will be updates of other sessions wait for this transaction to validate. Queries from other sessions are not affected.

    The locks are released when you commit or roll back.

  • Please let me know how I can add a new column with a constraint not null, table already has data, without falling off the table... Please help me on this issue...

    Hello

    I have an emp_job_det with a, b, c columns table. Note that this TABLE ALREADY has DATA OF THESE COLUMNS

    IAM now add a new column "D" with forced not null

    Fistly I alter the table by adding the single column "D", if I do, the entire column would be created with alll of nulls for the column DEFAULT D

    ALTER table emp_job_det Add number D; -do note not null CONSTRAINT is not added

    Second... If I try to add the constraint not null, get an eoor as already conatained null values...

    (GOLD)

    In other words, if I put the query

    ALTER table emp_job_det Add number D NOT NULL; -THROWS ERROR AS TABLE ALREADY CONTAINS DATA

    So my question is how how can I add a new column with a constraint not null, table already has the data, without falling off the table

    Please help me on this issue...

    Add the column without constraint, then fill the column. Once all the rows in the table are given in the new column, and then add the constraint not null.

  • 2 columns with the correct page breaks

    Hello

    I am producing a presentation of 2 columns in my form.

    The problem is: these columns span several pages and I can't right page breaks.

    I have a provision passed with two adjacent subforms that make my columns. In these column subforms I fill out a lot of data from XML.

    Problem 1: I get bored about 5 rows at the end of the page. They disappear into the page break.

    Problem 2: my second column starts to fill up on the second page (which is be the page where the first column ends).

    I also tried with a single table with exactly one line. But it disappear all lines after the first page and I get empty pages instead.

    Has anyone ever encountered this problem?

    What is a good way to build dynamic forms of 2 columns?

    Ulrich

    You will not be able to move beyond a page, then return to the previous page... .the data must be split so that the complete presentation of a page should occur before moving on to the next page.

    You can't go back in the time layout a page is complete... Sorry he just can't do that.

    Paul

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • Boxes with numbers and letters show rather than some images on some websites

    Yammer.com and linkedin.com, images of icons, such as those that display along the top of the screen are not displayed. Instead, I see a rectangle with numbers and letters. I've seen several articles on the rectangles with numbers and letters that apply to the characters but none regarding images. I also tried the steps described in the article on the resolution of the images is not properly displayed, and nothing seems to work.

    Thank you!

    Many sites now display icons using a custom font. Firefox could not be download and using this font personalized for two reasons:

    (1) Firefox to use your fonts favorite instead of the police of the page; or

    (2) Firefox configured to do not to download fonts.

    For more information, see this thread: Yahoo mail display - action buttons like reply, delete, before them and the colors are not displayed. The solution to "clear the cache" does not help.

  • "Allow pages to choose their own fonts and not my selection above" shows only the squares with numbers in them for all English characters

    Every time I select this option, firefox only displays the characters that appear when you don't have foreign fonts installed, with the exception of the English. The characters are squares with numbers inside at the bottom of the character.

    Try to set the Boolean gfx.font_rendering.directwrite.use_gdi_table_loading false pref on the topic: config page.

  • iCloud drive text files being opened with numbers

    Before, everything worked fine with text files (.txt files) I have in iCloud drive.

    A tap on iCloud drive and another click on a text file on my iPhone would open the file Notes.

    From some point on (I think I got the same text file open at the same time on my Mac and my iPhone) iCloud drive to text on my iPhone files are opened with numbers.

    Later, when I type a text file to the iCloud drive on my iPhone I have numbers open this file.

    When I press the information next to the name of text file icon, I get a screen of info saying at the top of the right page "open in numbers."

    I have the text file is a file in format (.rtf), there is no problem; Notes opens this file; and the Info screen, top right, for this file says nothing about the application that will open the file.

    This only happens on my iPhone; I have a 5 s, 64 GB, with the latest iOS 9.3.1

    On my Mac everything works fine.

    I tried a "Reset all settings" but that did not work.

    No idea of what is happening and how to fix?

    Even. .txt files will open in figures on iOS of the iCloud drive. Why is this and can it be changed?

Maybe you are looking for