txt ํ์ผ๋ก ๋ด๋ณด๋ด๊ธฐ
select *
from [ํ
์ด๋ธ๋ช
]
into outfile '[ํ์ผ๋ช
].txt' character set utf8mb4
fields terminated by ',', optionally enclosed by '"'
escaped by '\\'
lines terminated by '\n';
csv ํ์ผ๋ก ๋ด๋ณด๋ด๊ธฐ
select *
from [ํ
์ด๋ธ๋ช
]
into outfile '[ํ์ผ๋ช
].csv' character set utf8mb4
fields terminated by ',', optionally enclosed by '"'
escaped by '\\'
lines terminated by '\n';
txt ํ์ผ ํ ์ด๋ธ๋ก ์ฝ์ด์ค๊ธฐ
load data infile '[ํ์ผ๋ช
].txt'
into table [ํ
์ด๋ธ๋ช
] character set utf8mb4
fields terminated by ','
enclosed by '"'
lines terminated by '\n';
-- ignore 1 rows; -- ์ด ์ด๋ฆ ๋ฌด์ํ๊ณ ํ
์ด๋ธ์ ํ ์ ์ฅํ๊ธฐ (์ฒซ ์ค ๋ฌด์)
csv ํ์ผ ํ ์ด๋ธ์ ์ฝ์ด์ค๊ธฐ
load data infile '[ํ์ผ๋ช
].csv'
into table [ํ
์ด๋ธ๋ช
] character set utf8mb4
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 rows; -- ์ด ์ด๋ฆ ๋ฌด์ํ๊ณ ํ
์ด๋ธ์ ํ ๊ฐ์ ธ์ค๊ธฐ (์ฒซ ์ค ๋ฌด์)
728x90
'DB(Database) > MySQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Hackerrank SQL Occupations (0) | 2021.11.04 |
---|---|
[MySQL] ๋ค๋๋ค ๊ด๊ณ ํ ์ด๋ธ SQL ์ฟผ๋ฆฌ๋ฌธ์ผ๋ก JOIN ํ๊ธฐ (0) | 2021.02.16 |
[MySQL] ๋ด์ฅํจ์ - ์ํ ํจ์, ๋ ์ง/์๊ฐ ํจ์, ์์คํ /์ ๋ณด ํจ์ (0) | 2021.02.06 |
[MySQL] MySQL Workbench์์ ์๊ฒฉ ์๋ฒ ์ ์ํ๊ธฐ (0) | 2021.01.27 |
[MySQL] ๋ด์ฅํจ์ - ๋ฌธ์์ด ํจ์ (0) | 2021.01.20 |