Search code examples
oracle-databaseplsqlplsqldeveloper

How to insert all rows in a new table that have certain initials (pl/sql)


when a row contains the initial(s): 'H' I want to insert all the rows into a new table. How can I accomplish this?
This is the cmp_employer_employees table:
enter image description here


Solution

  • As long as the new table has the same structure as cmp_employer_employees, you can add the records where the initials are "H" with an insert like this:

    INSERT INTO new_table
        SELECT *
          FROM cmp_employer_employees
         WHERE initials = 'H';