Skip to content

Commit b535e00

Browse files
authored
MySQL Dump by Query
1 parent 0486acc commit b535e00

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Using temporary table and mysqldump
2+
CREATE TEMPORARY TABLE september_enrollments AS
3+
SELECT * FROM Student
4+
WHERE enrollment_date >= '2024-09-01'
5+
AND enrollment_date <= '2024-09-30';
6+
7+
8+
-- Using SELECT INTO OUTFILE Statement
9+
SELECT * FROM Student
10+
WHERE enrollment_date >= '2024-09-01'
11+
AND enrollment_date <= '2024-09-30'
12+
INTO OUTFILE '/path/to/september_enrollements.csv'
13+
FIELDS TERMINATED BY ','
14+
ENCLOSED BY '"'
15+
LINES TERMINATED BY '\n';

0 commit comments

Comments
 (0)