4 ms·
I'm just sure there's some important relational theory reason why you're a bad person for wanting to do this and it's not a flaw in the language at all that "ch
by Pxtl 3y ago
I'm just sure there's some important relational theory reason why you're a bad person for wanting to do this and it's not a flaw in the language at all that "check the equivalence of two result-sets" is so difficult.
- SOLAR_FIELDS 3y agoAh yes, the Apple support approach: “Why would you want to do that?”
- remywang 3y agoMy guess is that t1 = t2 seems cheap but is actually expensive, so you might accidentally write very slow queries if it were built into the language.
- Pxtl 3y agoUh, that ship has sailed. Sooooo sailed. It is incredibly trivially easy to write unsargable queries in SQL.
- bazoom42 3y agoYes there is! A table should have a primary key, which ensures no two rows in a table are exactly equal. So the simple solution with ‘a except b’ should work. Lots of otherwise simple things get complicated with duplicates, e.g. try to change or delete one row out of a set of duplicates. A table with duplicates is not even a relation, since relations are defined as sets. SQL is in a weird place because it technically allows duplicates, but many operations are not able to distinguish between duplicates.