title: Need a sql statement to do upate and insert at the same time
body: <p>I need a sql statement, to insert a new row in one database table and update an existing row in another database table based on some conditions.</p>
  
  <p>Is there a way to do this? To insert a row in one table and update a row in another database table in one sql statement?</p>
  
  <p>Thanks in advance!</p>