New column

Hello

My requirement is as follows: -.

ID name new column

1 34 FA women's Assembly

2 154 1 * 5 FA women's Assembly

3 male Assembly 45 2 * 3 MY

4 male mounting 5 * 9 MY

The query must seek '' female Assembly '' and '' Male Assembly '' on behalf of the 'NAME' column and create a new column 'F' and 'MA' respectively for each line.

Thanks in advance.

Hello

Select

ID,

name,

case

When instr ("name, ' female Assembly") > 0 then 'FA '.

When instr ("name, ' male Assembly") > 0 then 'MY '.

Another null

End Assembly

from your_table

Tags: Database

Similar Questions

  • 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

  • How can, during the collection of data, start a new column in my table every 100 data points?

    Hello! I have a problem with my data - I get in a wide range of 1 x 1000, but it's the repeated measures, each taking about 500 data points. I want to break this table for this data string start a new column in my table every 500 points given. I don't know how to do it-please help!

    datacompiler100 wrote:

    Hey thanks for the sponsor and the first off I must apologize for the State, I am attaching my VI. I put the part of the VI that I am working on (my team has access, so didn't post everything here) and also attached the data file (when just written in a spreadsheet file, not through the attached VI). I want to convert the long row of data and then start a new column every 50, 100, 5 points (user-defined).

    Using the data from the file, you can reshape everything simply (as you already!), followed by transposition (since you want columns instead of rows). 2D arrays must always be rectangular, so the last column is filled with zeros if necessary. Is that what you want?

    Of course if you try to add a new column in a file, that will not work. You can only add lines in an existing file because of the way the data is organized. To add columns, the entire file must be read, intertwined and all re-written new data in the file.

  • Add the new column of data

    Hey guys, I have a question for you novice. I read 4 analog channels and write all four of them in a file in four columns. A part of my program is counting the number of digital ups (TTL) and indicating a ' cycle count "with a shift register. I want to put this ' cycle count ' as a new column in my data file, alongside the other 4, preferably in the first column. I tried to connect the County directly to the VI measures, but it is not separating in his own column... ideas?


  • Can someone tell me if I can add a new column in the Explorer of Windows Vista or Windows Server 2008?

    Hello

    Previously in Windows XP and 2003, IColumnProvider is available using which it was possible to add a new column to Windows Explorer Details view, but with the removal of this API, the new columns are is not displayed in Windows Explorer on a Vista or Windows 2008 Server. It is said that there is a new concept of property system. So I would like to know if it is possible to implement something similar uses of property systems.

    These forums are for end users, rather than developers. You must use the MSDN Forums to get this kind of information.

    http://social.msdn.Microsoft.com/forums/en-us/categories

  • How to add the new column to a specific position

    Hello

    My table looks like Fallows.

    Select * from company

    PRODUCT_ID COMPANY_ID COMPANY_SHORT_NAME COMPANY_LONG_NAME
    11001An Inc.Long name A Inc.
    11002B Inc.Long name B Inc.
    11003C Inc.Long name C Inc.
    21004D Inc.Long name D Inc.
    21005E Inc.Long name E Inc.
    21006F Inc.Long name F Inc.

    My requirement is I would LIKE to add A NEW COLUMN AS COMPANY_LOCATION NEXT TO COMPANY_SHORT_NAME

    How to get there.


    I tried like Fallows alter company table add company_location varchar2 (100) after company_short_name;

    but this query shows the error

    ORA-01735: invalid option of ALTER TABLE

    If the query I've tried is correct?

    Give me your suggestions.

    Thanks in advance.

    As long as you're on 11 GR 2 or lower, it will not work.

    There is no Clause "AFTER"in the alter table do not add column."

    You have the chance to use dbms_redefinition (when no interruption of service is possible) or manually create a new table with the columns in the order you need and then migrate the data and then drop the original and rename a new.

    In case you are already on 12 c, you have a chance to add the column to the end and then make visible columns and invisible status in the right order. This way your column will get to the position that you want it to be.

    Kind regards

    Carsten

  • How to add the new column in existing table to our desired location?

    How to add the new column in existing table to our desired location?

    For example, I have to add the new column 'course' before the salary column in the emp table.

    I think the best way is to add the column at the end of the table and create a new view with the order of the columns...

    Another option...

    places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table

    Refer

    Add column (from table) in the desired position

    Example:

    CREATE TABLE temp_my_user LIKE)

    SELECT * FROM password);

    DROP TABLE password;

    (Password) CREATE TABLE

    userID NUMBER

    , first name VARCAHR2 (25)

    , middleInitial VARCHAR2 (1)

    (, name VARCHAR2 (25));

    INSERT INTO password (userID, firstName, lastName)

    (SELECT username

    first name

    lastName

    OF temp_my_user);

    DROP TABLE temp_user;

  • APEX 4.2.5 / OracleXE 11.2 g, how can I make a new column available in APEX?

    I have a request to work and added a new column in the table.

    How can I put this new field available to APEX and add it to a form of the APEX?

    Kind regards.

    -Wilfried

    Hi Wilfried,.

    Note the Source of the other elements on your form; they should be of the Type of Source - database column.  Add your new column to the shape as a new point using the same Type of Source.

    Jeff

  • Add the new column to the desired location in the table through customization?

    Hello world

    I made a few standard on oaf page customizations.
    I added 2 new columns to the existing table, but they were added at the end of the table.
    But I want a column to be the first and a column in the middle of the table.

    How can I achieve this?

    Please give me your valuable suggestions...

    Thank you.

    Hello

    Customize page, there is another icon for just before reorganization create icon.

    You can use and organize all the elements in the region of the table according to your requirement.

    Sushant-

  • Query took too much time when adding new column to the table and the index set on this

    I added a new column to the table that contains thousands of records. and created the composite index with three columns (those newly added + two existing column)

    for the specifics. TBL table there are two columns col1, col2

    I added the new column col3 to TBL and created composit index (col1, col2, col3).

    Now for all the records in col3 is NULL. When I choose on this table, it takes too long...

    Any idea what my I do bad., I have check the query plan, it is using the index

    It is solved using collection of statistics using the

    DBMS_STATS. GATHER_TABLE_STATS

    @Top.Gun thanks for your review...

  • Add a new column and update of records

    I have the DW (OBAW) loaded at full load. Everything works fine.

    Now, I add a new column in a dimension in the DW (and in the ETL, RPD, CAD, etc.).

    I know that new (incremental) charges will take care of this column for the new/changed records... but

    Question is how can I update records, already loaded into PS for values in this column...?

    (a) I guess I can do this particular task of this dimension marked as 'full' DAC

    I'm not sure it's a good solution... I guess new ROW_WIDs will be generated and I have the connection with the fact table will be broken... Right?

    (b) I could blank the date of updating for this table W_ and/or refresher for this table S_ (from Siebel)

    I guess this could affect more than one task... or in other words all tasks dealing with this tables W_ and S_ - it also seems that the issue with the new ROW_WIDs will continue...

    Pls someone care to comment or offer a better solution?

    TXS. A lot.

    Antonio

    Assume that the table is W_ASSET_D or any other dimension...

    Yes, I plan to the OOB card personalization (in the folder custom, etc.).

    So if I'm correct... the option for setting null date discount for the W_ASSET_D table... and the use of DAC pointing to the custom task will take care of him...

    Just to be sure... It will not create new ROW_WIDs for W_ASSET_D?

    I'm worried by the _F FKs to this dimension tables...

    TXS for your help.

  • Importing data with impdp table with 3 new columns

    Hello

    Is it possible to import data with impdp in tables with 3 new columns?

    Kind regards

    William

    To do this, I use this method:

    Add the three columns in the source table and create the package:

    CREATE OR REPLACE PACKAGE DATAPUMP_TECH_COLS

    IS

    FUNCTION SET_DML_DATE (p1 in TIMESTAMP)

    BACK TO TIMESTAMP;

    FUNCTION SET_DML_TYPE (p2 in VARCHAR2)

    RETURN VARCHAR2;

    FUNCTION SET_DML_SCN (p3 in NUMBER)

    RETURN NUMBER;

    END DATAPUMP_TECH_COLS;

    /

    CREATE OR REPLACE PACKAGE BODY SYS. DATAPUMP_TECH_COLS

    IS

    FUNCTION SET_DML_DATE (p1 in TIMESTAMP)

    RETURNS THE TIMESTAMP

    IS

    BEGIN

    SYSDATE RETURN;

    END;

    FUNCTION SET_DML_TYPE (p2 in VARCHAR2)

    RETURN VARCHAR2

    IS

    BEGIN

    RETURN ' ';

    END;

    FUNCTION SET_DML_SCN (p3 in NUMBER)

    RETURN NUMBER

    IS

    BEGIN

    RETURN 0;

    END;

    END;

    /

    Export a table with remap_data

    expdp = TEMP_DIR PARALLEL = 8 TABLES directory is PIVOTMAT2. ACCTG_LINE LOGFILE = expdp_acctg.log = COMPRESSION STATISTICS ALL EXCLUDE =.

    DUMPFILE = ACCTG1.dmp, ACCTG2.dmp, ACCTG3.dmp, ACCTG4.dmp, ACCTG5.dmp, ACCTG6.dmp, ACCTG7.dmp, ACCTG8.dmp REUSE_DUMPFILES = YES.

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_TYPE:SYS. DATAPUMP_TECH_COLS. SET_DML_TYPE.------

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_DATE:SYS. DATAPUMP_TECH_COLS. SET_DML_DATE.------

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_SCN:SYS. DATAPUMP_TECH_COLS. SET_DML_SCN

    Import table

    Impdp "" / as sysdba "" DIRECTORY = SRC_PIVOT TABLE_EXISTS_ACTION = TRONQUER REMAP_SCHEMA = PIVOTMAT2:STGPIV.

    DUMPFILE = ACCTG1.dmp, ACCTG2.dmp, ACCTG3.dmp, ACCTG4.dmp, ACCTG5.dmp, ACCTG6.dmp, ACCTG7.dmp, ACCTG8.dmp PARALLEL = 8

    to complete the removal of the collar if necessary.

  • How to fill the new column with values based on the subquery

    How can I fill a new column (teamid) with the following query below, at my table dept? I'm empty/null entries in teamid collar when I run the code ff:

    ALTER table dept add (teamid varchar2 (15));

    Update dept

    define the teamid = select upper (substr (deptname, 1, 3)) | Upper (substr (Color, 1, 2)) | rownum

    of the Department;

    Want to output:

    DEPTNAME COLOR TEAMID
    SALESORANGESALOR1
    ACCOUNTINGBLUEACCBL2
    BILLINGYELLOWBILL3
    SQL> create table dept as
      2  select 'SALES' deptname, 'ORANGE' color from dual union all
      3  select 'ACCOUNTING' deptname, 'BLUE' color from dual union all
      4  select 'BILLING' deptname, 'YELLOW' color from dual
      5  /
    Table created
    
    SQL>
    SQL> select * from dept;
    DEPTNAME   COLOR
    ---------- ------
    SALES      ORANGE
    ACCOUNTING BLUE
    BILLING    YELLOW
    
    SQL>
    SQL> alter table dept add(teamid varchar2(15));
    Table altered
    
    SQL> update dept set teamid = upper(substr(deptname,1,3)) || upper(substr(color,1,2)) || rownum;
    3 rows updated
    
    SQL> select * from dept;
    DEPTNAME   COLOR  TEAMID
    ---------- ------ ---------------
    SALES      ORANGE SALOR1
    ACCOUNTING BLUE   ACCBL2
    BILLING    YELLOW BILYE3
    
    SQL> rollback;
    Rollback complete
    
    SQL> drop table dept purge;
    Table dropped
    
    SQL>
    

    ----

    Ramin Hashimzade

  • Alter a table to add 2 new columns

    Hi gurus!

    Am editing a table to add 2 new columns... The total number of records in the table RAILWAY is -103002

    Here is the news columns to add to the IRON table.

    ALTER TABLE ADD IRON

    (DLD VARCHAR2 (5))

    ID NUMBER (38),

    VARCHAR2 (1)) READY.

    the statement takes more than 6 minutes to run, so I canceled the performance.

    can someone pelase I would like to know what is the reason here.


    Please ask your dBA to unlock it for you.

    Kill the session that locks the table.

    To view the session which can be locked using the below stated:

    Select c.owner, c.object_name, c.object_type, select, b.serial #, b.status, b.osuser, b.machine

    v $ locked_object a, v$ session b, c dba_objects

    where select = a.session_id

    and a.object_id = c.object_id;

  • 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.

Maybe you are looking for