SQL

ims·2020년 9월 3일
0

SQL

목록 보기
2/12

truncate

truncate table user

sql 초기화

truncate 안될 때

cannot truncate a table referenced in a foreign key constraint

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE Video;
TRUNCATE TABLE Category;
SET FOREIGN_KEY_CHECKS = 1;

https://wookmania.tistory.com/113

Where 1=1

조건문을 의미

https://hyjykelly.tistory.com/5

wildcard

wildcard?

https://docs.microsoft.com/ko-kr/sql/t-sql/language-elements/wildcard-match-one-character-transact-sql?view=sql-server-ver15

일치하는 문자 찾기

https://docs.microsoft.com/ko-kr/sql/t-sql/language-elements/percent-character-wildcard-character-s-to-match-transact-sql?view=sql-server-ver15

limit

SELECT * FROM study.user limit 0,5;

0번째부터 5개를 가져오겠다

order by

SELECT * FROM study.user order by id desc limit 0,5;

asc : 오름차순 , ascending , desc: 내림차순 descending

profile
티스토리로 이사했습니다! https://imsfromseoul.tistory.com/ + https://camel-man-ims.tistory.com/

0개의 댓글