Skip to content

Instantly share code, notes, and snippets.

@robjshaw
Last active December 14, 2015 04:09
Show Gist options
  • Select an option

  • Save robjshaw/5026513 to your computer and use it in GitHub Desktop.

Select an option

Save robjshaw/5026513 to your computer and use it in GitHub Desktop.
mysql temp table example
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