Hacker News new | past | comments | ask | show | jobs | submit login

One would expect to have to specify that with an asterisk or something and have blank just give a syntax error.



...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.


Not really. You could have a keyword ALL and UPDATE should require either WHERE or ALL.


This is telephony. '*' is indeed a valid element of a telephone number field.


Percent, 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.


Ask 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: