DELETE FROM `table` AS `alias` … WHERE `alias`.`column` … why syntax error?
What @Matus and @CeesTimmerman said about MSSQL, works in MySQL 5.1.73 too: delete <alias> from <table> <alias> where <alias>.<field>…
What @Matus and @CeesTimmerman said about MSSQL, works in MySQL 5.1.73 too: delete <alias> from <table> <alias> where <alias>.<field>…
It was certainly not the case at the time of your question, but right now :: is a valid ES7 operator. It’s actually a shortcut for bind. ::foo.bar is equivalent to foo.bar.bind(foo) See an explanation here for examples:
Note that you can observe this effect with not just do, but also let, if, \, case, the extensions mdo and proc…and the dread unary -. I cannot think of a case in which this is ambiguous except for unary -. Here’s how the grammar is defined in the Haskell 2010 Language Report, §3: Expressions. … Read more
Apparently, I was too lazy to read to the end of the documentation… Further down, the documentation states: subquery A subquery is used only in conjunction with the XML keyword. When you specify a subquery, all values found by the subquery are used for pivoting. […] This will work PIVOT XML (AVG(salary) FOR (company) IN … Read more
Guards are described in Haskell 2010 section 3.13, Case Expressions (that section is about case expressions, not top-level declarations, but presumably the semantics are the same): guards → | guard1, …, guardn (n ≥ 1) guard → pat <- infixexp (pattern guard) | let decls (local declaration) | infixexp (boolean guard) For each guarded expression, … Read more
It should be more common, but I suspect it is not because it makes parsing languages more complex. Benefits: Upholds the principle of least surprise Reads like math is taught Reduces cognitive load (see previous 2 points) Drawbacks: Grammar is more complex for the language Special case syntactic sugar As to why not, my guesses … Read more
If you look at the ALTER TABLE SYTAX you’ll see this ALTER TABLE [ database_name . [ schema_name ] . | schema_name . ] table_name { ALTER COLUMN column_name { [ type_schema_name. ] type_name [ ( { precision [ , scale ] | max | xml_schema_collection } ) ] [ COLLATE collation_name ] [ NULL … Read more
This is the inclusive range operator. The range x..=y contains all values >= x and <= y, i.e. “from x up to and including y”. This is in contrast to the non-inclusive range operator x..y, which doesn’t include y itself. fn main() { println!(“{:?}”, (10..20) .collect::<Vec<_>>()); println!(“{:?}”, (10..=20).collect::<Vec<_>>()); } // Output: // // [10, 11, … Read more
LOCK_ESCALATION = TABLE is the default behavior in SQL Server 2008 & is the ONLY behaviour in SQL Server 2005. You can safely drop the statement without any change in functionality.