Last active
February 23, 2016 20:12
-
-
Save tuxmartin/51eb7a83acb09d0bcc56 to your computer and use it in GitHub Desktop.
MySQL - vypsani mailu oddelenych carkou
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT email INTO OUTFILE '/tmp/users.txt' | |
LINES TERMINATED BY ', ' | |
FROM user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `user` ( | |
`id` int(11) NOT NULL, | |
`email` varchar(40) COLLATE utf8_czech_ci NOT NULL | |
) AUTO_INCREMENT=4; | |
INSERT INTO `user` (`id`, `email`) VALUES | |
(1, 'ahoj@svete.cz'), | |
(2, 'hello@world.com'), | |
(3, 'wtf@omg.lol'); | |
ALTER TABLE `user` | |
ADD PRIMARY KEY (`id`), | |
ADD UNIQUE KEY `email` (`email`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ahoj@svete.cz, hello@world.com, wtf@omg.lol, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment