Created
February 14, 2020 11:41
-
-
Save matthew-brett/21ccfb02a2cf58c67e24ad1af373ab8f to your computer and use it in GitHub Desktop.
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
/* Inspired by | |
https://www.mysqltutorial.org/mysql-subquery/ | |
*/ | |
DROP TABLE IF EXISTS stids; | |
CREATE TABLE stids SELECT steamid FROM ( | |
SELECT DISTINCT steamid FROM Games_1) AS stids | |
WHERE rand() < 0.1; | |
SELECT steamid, appid, playtime_forever FROM Games_1 | |
WHERE steamid in (SELECT steamid FROM stids) | |
INTO OUTFILE '/Volumes/rebrought/data/Games_1_stid_sample.csv' | |
FIELDS TERMINATED BY ',' | |
LINES TERMINATED BY '\n'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment