使用LIKE和NOT EQUAL的mysql查询一起运算符

I am trying to make an autocomplete field in Jquery UI which fetches values from a mysql table using the following query:

SELECT * FROM tags WHERE tagname LIKE ?

Currently, there is no check for duplicate values being selected again and again. To fix this, I am returning already available values through ajax within the autocomplete widget. However, I cannot seem to get the correct mysql query for this. I am passing the selected values as an array and running through a foreach loop in the following query.

SELECT * FROM tags WHERE tagname != :values AND LIKE ?

This isn't the correct syntax so I tried this:

SELECT * FROM (SELECT * FROM tags WHERE tagname != :values) WHERE tagname LIKE ?

This query is giving me the Every derived table must have its own alias error.

I know it is a pretty long question. I just want to be specific and rule out any suggestions which I have already tried.

I have gone through a lot of other questions and couldn't find anything so please don't mark it as a duplicate and ignore it.

The correct syntax is

SELECT * FROM tags WHERE tagname != :values AND tagname LIKE ?

Use This:-

It will Show result where tag name is not equal to first and starting with letter s.

SELECT * FROM tags WHERE tagname !='first' AND tagname  LIKE  's%'

Use Link For Like condition