Author Archives

Is this valid SQL syntax? :-)

I’m talking about this: select-1from from dual; Looks like invalid, right? Well, let’s run it: SQL> select-1from from dual;        ROM ———-  -1.0E+000 This is because: Oracle doesn’t need whitespace for tokenizing the SQL statement (differences in character classes will do – as I’ve explained here) The first from “keyword” in the above statement is [...]

Quiz: Explaining index creation

Did you know that it’s possible to use EXPLAIN PLAN FOR CREATE INDEX ON table(col1,col2,col3) syntax for explaining what exactly would be done when an index is created? That’s useful for example for seeing the Oracle’s estimated index size without having to actually create the index. You can also use EXPLAIN PLAN FOR ALTER INDEX [...]