title: Is it possible to reference a different column in the same table?
body: <p>If a blog has a 'categories' table such as the following: </p>
  
  <pre><code>CREATE TABLE categories
  (
    id INTEGER PRIMARY KEY AUTO_INCREMENT,
    parent_id INTEGER NOT NULL,
    name VARCHAR(30) NOT NULL,
    description TEXT,
    count INTEGER NOT NULL DEFAULT 0
  );
  </code></pre>
  
  <p>And if the parent_id field is intended to refer to the 'id' field of the categories table, then how could I add a constraint that would ensure that values inserted into parent_id references the id field? </p>
  
  <p>I simply want to make sure that only category id values that exist can be used as a parent of a newly inserted category. </p>