title: PL/SQL select into - if data exists
body: <p>I need to select into a local variable only if there exists data.</p>
  
  <pre><code>SELECT column1 INTO local_variable FROM table1 where column2 = &lt;condition&gt;;
  </code></pre>
  
  <p>Here if there is no data matching the condition I get a no data found error.</p>
  
  <p>I need to select into the local variable only if there is some data matching the condition. Is there a simple query that will solve my problem.</p>