title: SQL Statement to Update Rows using ids from another table
body: <p>and thanks in advance. I have a table called users which contains an id. I would like to collect the ids only from that table and run and insert using those ids as one of the arguments. I am new to SQL and having some trouble finding help or a solution.
  Here is the statement to get the ids
  <code>SELECT id FROM public.users</code>With the ids that are returned I would like to run an insert or update resembling <code>insert into public.history (user_id, password, change_time) values (&lt;ids from prev SELECT&gt;, 'password', now());</code>
  Can I generate a loop? Could someone point me in the right direction using purely sql, I know this can be achieved in php but I'd like to include this in an db init with SQL only.</p>