Mysql SELECT priority
<p>My database is missing some values:</p>

<pre><code>Name   Surname    Country   Salary

John   Walker     USA       800
       Walker     Canada    1000
Peter  Walker     Canada    800
John   Walker               900
Peter  Farmer     USA       1200
...    ...        ...
</code></pre>

<p>I want to SELECT Name and Surname and Country, if there are no values,
I want to SELECT by Name and Country, if there are no values,
I want to SELECT by Surname and Country.</p>

<p>I am using now:</p>

<pre><code>SELECT Salary FROM table_name
WHERE (Name='InputFromPHP' AND Surname='InputFromPHP' AND Country='InputFromPHP')
OR (Name='InputFromPHP' AND Surname='InputFromPHP')
OR (Name='InputFromPHP' AND Country='InputFromPHP')
</code></pre>

<p>I want to give priority, so it will select exactly what was Input With PHP, but when there are several values in database it gives SQL error.</p>

<p>Thanks a million in advance.</p>