What does a vertical bar mean in a SQL function call?
I'm learning SQL, and a lot of the examples have | (vertical bar) in function parameters. What does it represent? Like this:
TRUNC(column|expression, decimal places)
be开发者_高级运维tween column and expression.
It means "or". In that example you could have a column name or an expression.
A typical method of defining or explaining a grammar is with Backus-Naur Form (BNF) or some variation that is usually much less formal. In BNF, definitions that can have one of two or more choices often show the valid choices separated by a vertical bar. The example you show says that a couple of valid uses of TRUNC
are:
TRUNC( somecolumn, 5 )
TRUNC( colA * colB, 8 )
精彩评论