sagarswathi / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

Inaccurate documentation of the SELECT syntax #371

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The SELECT syntax documentation seems somewhat inaccurate:

http://www.h2database.com/html/grammar.html#select

The railroad diagram, as well as the BNF notation, seem to indicate that "FROM 
tableExpression" is a mandatory clause. However, any of the following 
statements are executed correctly by H2:

  select 1 where 1 = 1
  select 1 group by 1
  select 1 having count(*) = 1

Original issue reported on code.google.com by lukas.eder@gmail.com on 6 Jan 2012 at 11:40

GoogleCodeExporter commented 8 years ago
There are quite many statements that are parsed successfully but are not valid 
according to the BNF. In most cases, the reason is compatibility with other 
databases. I'm not sure if it really makes sense to document all possible 
variants, because that would complicate the documentation a lot, which would 
confuse people. Also, people wouldn't know which syntax is the most 'correct' 
one.

What is documented right now is what I believe is the syntax that *should* be 
used, because it's supported by other databases, or because it's part of the 
ANSI SQL standard.

Therefore, I would prefer not to document syntax that is only supported for 
compatibility.

Original comment by thomas.t...@gmail.com on 24 Jan 2012 at 8:00

GoogleCodeExporter commented 8 years ago
OK, I see. Thanks for the reply!

Original comment by lukas.eder@gmail.com on 24 Jan 2012 at 8:22