Oracle is one of the few databases that implements the SQL standard ORDBMS extensions, which essentially allow for nested collections. Other databases that have these features to some extent are CUBRID, Informix, PostgreSQL. Oracle has two types of nested collections: The main difference at first is that a nested table can be of arbitrary size, … Continue reading How to…
#intersect
4 posts
15 Aug 2018
2 Jun 2017
ANOTHER SQL Post this week? I got nerd-sniped: Lazy Internet: In Oracle, how do i query for where (A, B, C) in (('a', 'b', null), 'a', null, 'c') considering Oracle's null handling? — Rafael Winterhalter (@rafaelcodes) June 2, 2017 Oooooh, challenge accepted! So, let’s assume we have a table T with columns (A, B, C) … Continue reading How to…
6 Oct 2015
When people talk about SQL JOIN, they often use Venn Diagrams to illustrate inclusion and exclusion of the two joined sets: While these Venn diagrams are certainly useful to understand (and remember) SQL JOIN syntax, they’re not entirely accurate, because SQL JOIN is a special type of a cartesian product, the CROSS JOIN. In a … Continue reading You Probably…
4 Aug 2015
Have you ever wondered how you could express a predicate that “feels” like the following, in SQL: /u/CyBerg90 has, on reddit. The idea was to create a predicate that yields true whenever both values Var1 and Var2 yield either 1, 2, or 3. The canonical solution The canonical solution would obviously be to write it … Continue reading INTERSECT –…