title: How to INSERT - WHERE NOT EXISTS on another table with a matching column?
body: <p>I am looking for a SQL statement that would read similar to this:</p>
  
  <pre><code>INSERT INTO some_table
    (a, b, c)
  VALUES
    ('a', 'b', 'c')
  RETURNING
     a
  WHERE NOT EXISTS
  (
    SELECT
      some_column
    FROM
      another_table
    WHERE
      some_cond='is_true'
  );
  </code></pre>
  
  <p>Above wouldn't work as <code>WHERE NOT EXISTS</code> is to be followed by <code>SELECT FROM</code> not <code>INSERT INTO</code>. How can I insert into a table only when a select statement on another table returns nothing?</p>
  
  <p>EDIT2:</p>
  
  <p>Changed database schema to contain a matching column on other table and not null constrain on matched 'to-be-inserted-into' column to use sub-query with select to get the intended functionality and use what @Isaiah3015 suggested.</p>