Created
October 27, 2019 08:32
-
-
Save moriya-hm5/5fca6fffce76527326aa7f2bc503586d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> insert into m_emp (empno,empname,departmentid) values (3,'takahashi','101010'); ← empnoを3で指定する | |
Query OK, 1 row affected (0.29 sec) | |
mysql> select * from m_emp; | |
+---------------------+------------+--------------+ | |
| empno | empname | departmentid | | |
+---------------------+------------+--------------+ | |
| 3 | takahashi | 101010 | ← レコードが追加されている | |
| 5 | 従業員A | 10101001 | | |
| 6 | 従業員B | 10101001 | | |
| 7 | 従業員C | 10101002 | | |
| 8 | 従業員D | 10101003 | | |
| 1234567890123456789 | NULL | NULL | | |
| 1234567890123456790 | takahashi | 101010 | | |
+---------------------+------------+--------------+ | |
7 rows in set (0.00 sec) | |
mysql> select last_insert_id(); | |
+---------------------+ | |
| last_insert_id() | | |
+---------------------+ | |
| 1234567890123456790 | ← 変わっていない | |
+---------------------+ | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment