What does SQL Select symbol || mean?

|| represents string concatenation. Unfortunately, string concatenation is not completely portable across all sql dialects: ansi sql: || (infix operator) mysql: concat ( vararg function ). caution: || means ‘logical or’ (It’s configurable, however; thanks to @hvd for pointing that out) oracle: || (infix operator), concat ( caution: function of arity 2 only ! ) … Read more

In MySQL, should I quote numbers or not?

MySQL is a lot like PHP, and will auto-convert data types as best it can. Since you’re working with an int field (left-hand side), it’ll try to transparently convert the right-hand-side of the argument into an int as well, so ‘9’ just becomes 9. Strictly speaking, the quotes are unnecessary, and force MySQL to do … Read more

How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM in SQL Server 20008R2?

The IS DISTINCT FROM predicate was introduced as feature T151 of SQL:1999, and its readable negation, IS NOT DISTINCT FROM, was added as feature T152 of SQL:2003. The purpose of these predicates is to guarantee that the result of comparing two values is either True or False, never Unknown. These predicates work with any comparable … Read more