I am hoping someone can help me with a SQL question. I don’t think its specific to MariaDB but that is the database I have a question on.
My question is on the SELECT statement in particular the OR operator within SELECT.
When I use the OR operator trying to do a query. I want to see the results from a table named titles (within employees database) that shows the employee number that is greater than 200,000 (emp_no) OR does NOT contain ‘Engineer’ in the title(title). If I do the statement with an AND operator it works. When I change it to an OR operator neither column returns the results from the WHERE statement.
SELECT * FROM titles WHERE emp_no > ‘200000’ AND title !=‘engineer’;
SELECT * FROM titles WHERE emp_no > ‘200000’ OR title !=‘engineer’;
I have tried with and without (’) around 200000 and case does not matter.
Hopefully this is OK to ask here maybe someone can point me to a place to find the answer (I am watching more videos on this after a couple days of reading). Thanks in advance.