Online Notes
SQL

INSERT from SELECT

  • Snippets

1
2
3
4
INSERT INTO table2
(column_name(s))
SELECT column_name(s)
FROM table1;

 

Related posts

  • UPDATE query based on SELECT Query
  • How to Back Up and Restore a MySQL Database
  • MySQL Search and Replace Query
  • Switch case (UPDATE)
  • What are the different SQL JOINs ?
  • SELECT Null
  • How to use SQL LIKE condition with multiple values in PostgreSQL?
  • How do I check if a column is empty or null in mysql
  • SQL Introduction
  • ALTER Column SET NOT NULL – pgSQL

Recent SQL Snippets

  • Generate Slug URL in MySQL
  • How to use SQL NOT LIKE condition with multiple values in PostgreSQL?
  • How to use SQL LIKE condition with multiple values in PostgreSQL?
  • SELECT Null
  • ALTER Column SET NOT NULL – pgSQL
  • ADD new Column – pgSQL
  • WITH RECURSIVE
  • UPDATE from SELECT
  • Switch case (UPDATE)
  • INSERT from SELECT

Recent Snippets

  • How to Install Angular on Ubuntu (18.04 & 16.04)
  • Install Node.js in Ubuntu
  • Angular CLI & Troubleshooting
  • Simple POJO Example - Employee
  • Hibernate Example Configuration File — hibernate.cfg.xml

Recent Examples

  • How to reverse Singly Linked List?
  • Find out duplicate number between 1 to N numbers.
  • Find out middle index where sum of both ends are equal
  • Write a singleton class in Java
  • Write a java program to reverse a string?

Recent Questions

  • What are the modules of spring framework?
  • List some of the Spring Framework Annotations?
  • How many types of association mapping are possible in hibernate?
  • Define persistent classes?
  • What is HQL?

  • Contact

All Right Reserved © Online Note