4 ms·
Its is exactly doing what you tell it to do, update without filter, it updates all.
by GrumpyNl 9y ago
Its is exactly doing what you tell it to do, update without filter, it updates all.
- yjftsjthsd-h 9y agoOne would expect to have to specify that with an asterisk or something and have blank just give a syntax error.
- mannykannot 9y ago...until one thinks it through and realizes that this would require that special value as an extra condition for every attribute in every relation mentioned in the query, which in turn would eliminate both the theoretical elegance of the relational model and the many very practical benefits that arise from it. A secondary problem is what to do if '*' is a valid value... Ad-hoc solutions are often more difficult than they first seem.
- aexaey 9y agoPercent, rather than asterisk. UPDATE t SET foo='bar' WHERE baz LIKE '$INPUT'; This will do no changes when $INPUT is empty, and only with $INPUT set to '%' will it update every record.
- JdeBP 9y agoAsk yourself how many search forms you have filled in where you are allowed to leave the fields that you are not searching on blank. That is a fairly common design.