I am using a query which its searching inside a table for two conditions. I will give an example:
Select *
from Customers
where mobile= '" + textboxt1.Text + "' or Phone = '" + textboxt1.Text + "'
The query returns me the first row which mobile or phone numbers is equal with my textbox1.Text
.
I need to set a condition: start looking "entire table" for find the first 'or' statement(mobile). If there is not exist any result then go and search again entire table using the second or condition (Phone).
Is there any easy way which i can write my query? Or do I need to use a case for this?