์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ๋ฆฌ๋ ์ค
- Spring
- ํ ์ด๋ธ
- SQL
- ์ธ๋ผ์ธ๋ทฐ
- Update
- DATE_FORMAT
- ๋ช ๋ น์ด
- Ajax
- post๋ฐฉ์
- JSP
- ํ๋ก๊ทธ๋๋จธ์ค
- MySQL
- ๋ฐฑํฑ
- JavaScript
- ๋ณ์
- ๋์ปค
- optionํ๊ทธ
- ๋์
- order by
- like
- JS
- ์ฝํ
- select
- ์๋ฐ์คํฌ๋ฆฝํธ
- ๋์ ํ ์ด๋ธ
- ๋ฐฐ์ด
- oracle
- ์ปจํธ๋กค๋ฌ
- ํจ์
- Today
- Total
๋ชฉ๋กDeveolpment Study๐๏ธ/Databases (37)
bom's happy life
ํ ์คํธ๋ฅผ ํ๋ค๋ณด๋ฉด ์ฌ๋ฌ๋ฒ CRUD๋ฅผ ๋ฐ๋ณตํ๋ฉด์ auto_increament๊ฐ ๋์กํด์ง๊ณ , ๋ค ์ง์ฐ๊ณ ์๋ก insertํ๋๋ผ๋ 1๋ถํฐ ์์ํ์ง ์๋๋ค. 1. SET ๋ช ๋ น์ผ๋ก ๋ณ์ COUNT๋ฅผ 0์ผ๋ก ์ค์ ํ๋ค. mysql> SET @count=0; 2. UPDATE ๋ช ๋ น์ผ๋ก AUTO_INCREAMENT์ ์นผ๋ผ์ 1๋ถํฐ ์์๋๋ก ์ ๋ ฌํ๋ค. mysql> UPDATE ํ ์ด๋ธ ์ด๋ฆ SET ์ปฌ๋ผ ์ด๋ฆ=@count:=@count+1; ์ด๋ ๊ฒ ํ๋ฉด ๋ค์ 1๋ถํฐ ์ ๋ ฌ๋์ด ์์ด ๋ปฅ๋ค๋ฆฐ๋ค!
https://velog.io/@nohsangwoo/mysql-%ED%95%9C%EA%B8%80-insert-%EC%95%88%EB%90%A0%EB%95%8C mysql - ํ๊ธ insert ์๋ ๋, ํ๊ธ ํ์์๋ ๋ CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;CREATE DATABASE database_name DEFAULT CHARACTER SET euckr COLLATE eu velog.io https://shxrecord.tistory.com/106
https://blog.dalso.org/article/mysql-mariadb-dump MySQL(MariaDB) DB ๋คํ ์ฌ์ฉ๋ฒ. - ๋ฌ์์จ์ ํ๋ฃจ MySQL ํน์ MaraiDB๋ฅผ ์ฌ์ฉํ์ค๋ DB๋ฅผ ์ด๋ํ๋ ๊ฒฝ์ฐ๊ฐ ์๊ธฐ์ค์๋์์ต๋๋ค. ์ด๋ด๋์๋ DB dump๋ฅผ ๋ ์ ์ด๋ ํ ๋ณต๊ตฌํ๋ฉด ๊ฐ๋จํ๊ฒ ์ด๋์ด ๋๋๋ฐ ๊ฐ๋จํ๊ฒ ์งํํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ์ค์ตํ๊ฒฝ dump blog.dalso.org
1. ํน์ ๋ฌธ์์ด๋ก ์์ํ๋ ๋ฐ์ดํฐ ๊ฒ์(LIKE '๋ฌธ์์ด%') -- ๊ตฌ์กฐ SELECT ์ปฌ๋ผ๋ช FROM ํ ์ด๋ธ๋ช WHERE ์ปฌ๋ผ๋ช LIKE 'ํน์ ๋ฌธ์์ด%'; -- EX) SELECT title FROM board WHERE title LIKE '๋๊ธ%'; 2. ํน์ ๋ฌธ์์ด๋ก ๋๋๋ ๋ฐ์ดํฐ ๊ฒ์( LIKE '%๋ฌธ์์ด') -- ๊ตฌ์กฐ SELECT ์ปฌ๋ผ๋ช FROM ํ ์ด๋ธ๋ช WHERE ์ปฌ๋ผ๋ช LIKE '%ํน์ ๋ฌธ์์ด'; -- EX) SELECT title FROM board WHERE title LIKE '%๋๊ธ'; 3. ํน์ ๋ฌธ์์ด์ด ๋ค์ด๊ฐ๋ ๋ฐ์ดํฐ ๊ฒ์( LIKE '%๋ฌธ์์ด%') -- ๊ตฌ์กฐ SELECT ์ปฌ๋ผ๋ช FROM ํ ์ด๋ธ๋ช WHERE ์ปฌ๋ผ๋ช LIKE '%ํน์ ๋ฌธ์์ด%'; -- EX) SELECT title FRO..