티스토리 뷰
Syntax:
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
{VALUES | VALUE} ({expr | DEFAULT},...),(...),...
[ on DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]
Or:
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name
SET col_name={expr | DEFAULT}, ...
[ on DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]
Or:
INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
[ on DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]
> select * from topic;
+----+------------+-------------------+---------------------+----------+---------+
| id | title | description | created | author | profile |
+----+------------+-------------------+---------------------+----------+---------+
| 1 | MySQL | MySQL is... | 2018-01-01 12:10:11 | egoing | NULL |
| 2 | Oracle | Oracle is ... | 2018-01-03 13:01:10 | kio | NULL |
| 3 | SQL Server | SQL Server is ... | 2018-01-20 11:01:10 | kiostory | NULL |
| 4 | PostgreSQL | PostgreSQL is ... | 2018-01-23 01:03:03 | freebee | NULL |
| 5 | MongoDB | MongoDB is ... | 2018-01-30 12:31:03 | cookieg | NULL |
+----+------------+-------------------+---------------------+----------+---------+
5 rows in set (0.0059 sec)
> insert into topic values('','CUBRID','CUBRID is ...',now(),'kio','I am me.');
Query OK, 1 row affected, 1 warning (0.0111 sec)
Warning (code 1366): Incorrect integer value: '' for column 'id' at row 1
> select * from topic;
+----+------------+-------------------+---------------------+----------+----------+
| id | title | description | created | author | profile |
+----+------------+-------------------+---------------------+----------+----------+
| 1 | MySQL | MySQL is... | 2018-01-01 12:10:11 | egoing | NULL |
| 2 | Oracle | Oracle is ... | 2018-01-03 13:01:10 | kio | NULL |
| 3 | SQL Server | SQL Server is ... | 2018-01-20 11:01:10 | kiostory | NULL |
| 4 | PostgreSQL | PostgreSQL is ... | 2018-01-23 01:03:03 | freebee | NULL |
| 5 | MongoDB | MongoDB is ... | 2018-01-30 12:31:03 | cookieg | NULL |
| 6 | CUBRID | CUBRID is ... | 2019-02-25 14:14:34 | kio | I am me. |
+----+------------+-------------------+---------------------+----------+----------+
'IA > DB' 카테고리의 다른 글
[mysql] update (0) | 2019.02.26 |
---|---|
[mysql] timezone 변경 on RDS, AWS (0) | 2019.02.25 |
[mysql] update (0) | 2019.02.25 |
[mysql] Alter table (0) | 2019.02.25 |
[mysql] JOIN : Left (0) | 2019.01.01 |
- Total
- Today
- Yesterday
- exadata
- EXA
- Join
- dezoomify
- dp-2
- dp-1
- oracle
- virt-sysprep
- fromkeys
- sysprep
- cloud-init
- 배열
- powershell
- 변수화
- powercli
- 차집합
- storage
- vmware.powercli
- artandculture
- insert
- vmware
- 중복제거
- 스토리지
- 읽어오기
- 3par
- 정렬
- set()
- 대소문자
- LIST
- 부동없이
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |