title: CREATE TABLE AS - how to add column with PK?
body: <p><br>
  I have to create a table (H2 embedded database) using fields from other tables. I decided to use <code>CREATE TABLE AS</code> statement.</p>
  
  <p>My code:<br>
  <code>CREATE TABLE DOC AS</code><br>
  <code>SELECT I.ID, I.STATUS, A.REMINDERINFORMATION</code><br>
  <code>FROM IE802 I JOIN IE802_ATTRIBUTES A ON A.IE802_ID=I.ID;</code></p>
  
  <p>Each row which is generated from the code above additionally must have <code>DOCID</code> PrimaryKey. How can I add this column and make it autoincrement and PK at the same time?</p>
  
  <p>Thanks for any tips and other solutions!</p>
  
  <p>Alternatively, how can I make existing I.ID to be PK?</p>
  
  <p>I'm still getting an error: Column "ID" must not be nullable; SQL statement:
  ALTER TABLE DOC ADD PRIMARY KEY (ID) [90023-147]</p>