For example, if I have a table like this
----------------------
| id | year |
----------------------
| 1 | 01-JAN-95 |
| 2 | 01-JAN-96 |
| 3 | 01-JAN-97 |
| 4 | 02-JAN-97 |
| 5 | 03-JAN-97 |
----------------------
…and I wanted to select everything that is not from the year 1997, how would I do this?
I know I can do:
SELECT * FROM table WHERE year not like '%97';
But is there a more efficient way?
SELECT * FROM table WHERE YEAR(year) <> '1997'// fixed logic