Randomly selected quiz question (want a different question? Click here):
The following query is really very simple: there's not even a table involved.
What is the result of this expression ?
1> select +2*-1*-3+-2--1*+3
The result of this expression is 4 (did you think it was 7 ?)
This is a bit of trick question: the clue is that the characters -- are actually a comment according to the ANSI SQL syntax.
Therefore, the expression being evaluated only consists of +2*-1*-3+-2, and --1*+3 is ignored as a comment.
As I said, this is a trick question, and all those + and - signs are only there to trick you into the wrong answer!
It's not completely hypothetical however: I once made this mistake myself...
More ASE quiz questions: 2013 - 2012 - 2011 - 2010 - 2009 - 2008 - 2007 - 2006 - 2005 - 2004 - 2003 - 2002 - 2001
For a randomly selected quiz question, click here.