티스토리 뷰

프로그래밍/C#

mysql update 문 실습

뽀로로친구에디 2018. 9. 21. 22:56

mysql update 문 실습 


MariaDB [opentutorials]> desc topic;

+-------------+--------------+------+-----+---------+----------------+

| Field       | Type         | Null | Key | Default | Extra          |

+-------------+--------------+------+-----+---------+----------------+

| id          | int(11)      | NO   | PRI | NULL    | auto_increment |

| title       | varchar(100) | NO   |     | NULL    |                |

| description | text         | YES  |     | NULL    |                |

| created     | datetime     | NO   |     | NULL    |                |

| author      | varchar(30)  | YES  |     | NULL    |                |

| profile     | varchar(100) | YES  |     | NULL    |                |

+-------------+--------------+------+-----+---------+----------------+

6 rows in set (0.00 sec)


MariaDB [opentutorials]> select * from topic;

+----+------------+------------------+---------------------+--------+-------------------------+

| id | title      | description      | created             | author | profile                 |

+----+------------+------------------+---------------------+--------+-------------------------+

|  1 | mysql      | mysql is...      | 2018-09-21 21:26:22 | egoing | developer               |

|  2 | orcle      | orcle is..       | 2018-09-21 21:30:37 | egoing | devloper                |

|  3 | sql server | sql server is... | 2018-09-21 21:32:08 | duru   | data administator       |

|  4 | postsql    | postsql is...    | 2018-09-21 21:36:45 | taeho  | data scientist devloper |

|  5 | mongodb    | mongdb is..      | 2018-09-21 21:37:55 | egoing | devloper                |

+----+------------+------------------+---------------------+--------+-------------------------+

5 rows in set (0.00 sec)

 


MariaDB [opentutorials]> update topic set description = 'sql is...', title='sql' where id = 3;

Query OK, 1 row affected (0.01 sec)

Rows matched: 1  Changed: 1  Warnings: 0


MariaDB [opentutorials]> update topic set description = 'oracle is..', title='oracle' where id =2;

Query OK, 1 row affected (0.01 sec)

Rows matched: 1  Changed: 1  Warnings: 0



MariaDB [opentutorials]> select * from topic;

+----+---------+---------------+---------------------+--------+-------------------------+

| id | title   | description   | created             | author | profile                 |

+----+---------+---------------+---------------------+--------+-------------------------+

|  1 | mysql   | mysql is...   | 2018-09-21 21:26:22 | egoing | developer               |

|  2 | oracle  | oracle is..   | 2018-09-21 21:30:37 | egoing | devloper                |

|  3 | sql     | sql is...     | 2018-09-21 21:32:08 | duru   | data administator       |

|  4 | postsql | postsql is... | 2018-09-21 21:36:45 | taeho  | data scientist devloper |

|  5 | mongodb | mongdb is..   | 2018-09-21 21:37:55 | egoing | devloper                |

+----+---------+---------------+---------------------+--------+-------------------------+

5 rows in set (0.01 sec)


'프로그래밍 > C#' 카테고리의 다른 글

mysql 테이블 분리하기  (0) 2018.09.22
mysql delete문 실습  (0) 2018.09.21
mysql select문 실습  (0) 2018.09.21
mysql 테이블 insert 실습  (0) 2018.09.21
mysql 테이블 생성하기  (0) 2018.09.21
댓글
최근에 달린 댓글
글 보관함
«   2025/01   »
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
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글