Last active
December 14, 2015 04:09
-
-
Save robjshaw/5026513 to your computer and use it in GitHub Desktop.
mysql temp table example
This file contains hidden or 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
| DROP TEMPORARY TABLE IF EXISTS tempTable; | |
| CREATE TEMPORARY TABLE tempTable (id INT, fkid INT, comment TEXT); | |
| INSERT INTO tempTable SELECT id, fid, comment FROM table WHERE DATE(commentDate) = DATE_ADD(DATE(now()), INTERVAL -2 DAY); | |
| SELECT * FROM tempComment WHERE comment like 'textstring%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment