title: Conditional statements in MySQL
body: <p>I have two tables that I am trying to match data by last name and first name. Since I have multiple customers with the same name, I would like to try to see if (out of the previous query) either the phone number or street address match. Is there any way to do this in one statement?</p>
  
  <p>My simple statement so far is:</p>
  
  <pre><code>SELECT * 
  FROM table1, table2
  WHERE table1.LAST_NAME = table2.LAST_NAME 
  AND table1.FIRST_NAME = table2.FIRST_NAME 
  </code></pre>
  
  <p>I am not sure if there is a way to do something like the following in just MySQL:
  IF (table1.LAST_NAME = table2.LAST_NAME) AND (table1.FIRST_NAME = table2.FIRST_NAME) equals a result AND a duplicate is found, match based on street address OR phone. And if no duplicate is found, simply match by name.</p>