title: H2 database CREATE TABLE with constraint
body: <p>I have two SQL statements:</p>
  
  <pre><code>CREATE TABLE legs(legid INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
                    playerid1 INT NOT NULL REFERENCES players(playerid),
                    playerid2 INT NOT NULL REFERENCES players(playerid),
                    added TIMESTAMP AS CURRENT_TIMESTAMP NOT NULL);
  
  ALTER TABLE legs ADD CONSTRAINT distinct_players CHECK(playerid1 &lt;&gt; playerid2);
  </code></pre>
  
  <p>I am 99% sure I should be able to condense them into one, i.e:</p>
  
  <pre><code>CREATE TABLE table(...
                     playerid2 INT NOT NULL REFERENCES players(playerid) CHECK(playerid1 &lt;&gt; playerid2),
                     ...);
  </code></pre>
  
  <p>However, I am consistently getting a syntax error.  AFAIK, this is where the constraint should be.</p>