SELECT "Ticket_id" FROM "Tickets"
WHERE "Status" = 1 AND ("Ticket_id" != ANY(array[1,2,3])) Limit 6
And the result is 1,2,3,4,5,6
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You want to use
ALL, notANY. From the fine manual:So if we say this:
then we’ll get true since
(1 != 1) or (1 != 2)is true.ANYis essentially anORoperator. For example:If we look at
ALL, we see:so if we say this:
then we’ll get false since
(1 != 1) and (1 != 2)is false and we see thatALLis essentially anANDoperator. For example:If you want to exclude all values in an array, use
ALL: