본문 바로가기

DataBase/MySQL

MySQL-read,update

0. read

*google검색: mysql select syntax

1. 우리가 만든 topic table 전체보기

SELECT *FROM topic;

 

2.보고싶은 colum들만 보기

SELECT (우리가 표시하고 싶은 colum들의 목록)FROM topic;

 

3.author의 값이 egoing인 행만 보기

SELECT id, title, created, author FROM topic WHERE author = 'egoing';

 

4.id값의 역순으로 보기

SELECT id, title, created, author FROM topic WHERE author = 'egoing' ORDER BY id DESC;

 

5.데이터를 가져올때 제약을 걸기

~~~ LIMIT 2;(2행만 가져옴)

 

 

0. updata

*google검색 : SQL updata Mysql

 

UPDATE topic SET description='Oracle is ...', title='Oracle' WHERE id=2;

 

0.delete

*google검색 : SQL delet in mtsql

 

DELETE FROM topic WHERE id=5;

'DataBase > MySQL' 카테고리의 다른 글

Internet & database  (0) 2020.08.27
관계형데이터베이스의 필요성  (0) 2020.08.26
MySQL-create row  (0) 2020.08.24
MySQL- table 만들기  (0) 2020.08.23
MySQL- 정의  (0) 2020.08.22