If you delete multiple databases, whereid1orid2orid3 ...... however, the deletion id is assembled by a number. My approach is to traverse and delete the id. Is there a simple way to delete the id without traversing? Include in, notin, BETWEEN in range, not...
If you delete multiple databases, the where id = 1 or id = 2 or id = 3 ......
However, the deletion id is assembled by a number. My approach is to traverse and delete the id.
Is there a simple way to delete without traversing?
There are also in, not in, BETWEEN is in the range, not BETWEEN is not in the range
What do these four mean?
Reply content:
Example
If you delete multiple databases, the where id = 1 or id = 2 or id = 3 ......
However, the deletion id is assembled by a number. My approach is to traverse and delete the id.
Is there a simple way to delete without traversing?
There are also in, not in, BETWEEN is in the range, not BETWEEN is not in the range
What do these four mean?
In (1, 2, 3, 4) is all in the brackets
Not in (,), that is, all the non-conformities in the brackets
Between 9 and 12, that is, 9-12 (9, 10, 11, 12) in this range all match
Not between 12 and 15, that is, 12-15 (,) all do not match
The simplest one is to write it and read the results.
You can delete multiple entries. Since it is encapsulated into an array, you can convert it into a comma-separated string and put it in.
Delete from table where id in (1, 2, 3) # id of 1, 2, 3
Delete from table where id not in (1, 2, 3) # All records except 1, 2, 3
Delete from table where id between 1 and 5 # id 1-3
Delete from table where id not between 1 and 5 # All records except 1-5
Delete from table where id in (1, 2, 3 ))
Convert your array to a string of "1, 2, 3 ".