title: MySQL: IF table exists, truncate and insert ELSE create
body: <p>Working only with MySQL (I have essentially <em>no</em> PHP knowledge), I need to have a table that's essentially a subset from a much larger table.  The source table changes from time to time, losing some entries, gaining other new ones, and values changing for existing ones.  I can describe what I want to happen, but can't seem to figure out a syntax of commands to make it work.  I also know I can have two separate queries and just run whichever one I need, and I have that worked out, but I'd like to combine them if possible.  Here's what I want:</p>
  
  <p>IF the subset_table DOES NOT EXIST, create it as [select query], ELSE truncate the subset_table and insert [select query]</p>
  
  <p>Like I said, I know there are other ways to do this - I could drop if exists/create, or I could just have two different sql files to run.  I just want to know if I can do this as specified above.</p>
  
  <p>Thoughts?</p>