Answer the question
In order to leave comments, you need to log in
How to invert a selection of records in MySQl?
The task is, there is an array of records that needs to be added to the table (they may already be in the table), and for all other records in the table (which are not in the array), change the activity field to false.
Mono, of course, to "program" but I want to use my mind. So that there are no extra requests.
In essence, you need to select records that are not in the array and set them to false.
let the fields be ID, NAME, ACTIVE
Answer the question
In order to leave comments, you need to log in
Why not do two queries:
1) Set all records to false
2) Add new records (INSERT IGNORE INTO table ...)
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question