SQL INSERT: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:


=Conditional <tt>INSERT</tt>=
=Conditional <tt>INSERT</tt>=
Also see: {{SQL_WHERE#SQL_Conditional_Logic|SQL Conditional Logic}}

Revision as of 20:00, 30 May 2024

External

Internal

Overview

INSERT INTO person (id, name) VALUES (1, 'Binh Ngo');
PostgreSQL MySQL

The column names and the values provided must correspond in number and type. The INSERT statement may not contain a WHERE clause, because there is no previous data for this row WHERE may apply to.

Conditional INSERT

Also see: Template:SQL WHERE