mysql - How do I know which is a function and which is an operator? -


MySQL has both jobs and operators however, it is a voluntary It is unclear for the keyword that it is a function or operator. For example, I believe that ASCII () is a function manual of the section) However, as as is also visible there, and it is not a function; For example, because the syntax does not force (...) after the preferred keyword, and it mentions that

< P> By default, there should be no white space between the function name and parenthesis.

In some cases it is clear, for example, the keyword IN appears in the manual (a non-disclosed section name), and in this IN () by name (like it was a function), but example SELECT 2 IN (0,3,5,7); , which indicates that it is an operator (see the post after the keyword).

In the same section, is INTERVAL () . Careful reading shows the following line in this keyword description:

It is necessary that N1 & lt; N2 and lieutenant; N3 & Lt; ... & lt; Nn for this function to work properly.

which indicates that it is actually a function, and is not an operator. At least () , which also appears there, does not mention that this is a function or operator.


My questions are as follows:

  • Does anyone among the concepts of function and operator in MySQL Is internal difference?
  • Is there a way to find out, given a keyword, is this the function of an operator?
  • Can there be a reference, based on context? I know that some keywords can both a function and a type, for example.

I want to know that syntax highlighting to understand the composition of both MySQL and its use.

MySQL provides a list of "non-type" operators.

Basically, a function is used in the list of arguments attached to the parentheses. Even functions that do not take logic, like now () require brackets.

On the other hand, an operator is part of the MySQL query language syntax. This is known for the parser, who recognizes him. Operators often use "infix" notation, where operator appears between arguments. However, this is not necessary (just consider the unemployed minus operator).

A cursory view in the list of operators shows that there can be both an operator and a function, an example is mod () .

The most important difference to me is that users can set tasks but users can not define operators (yet), unlike object oriented languages, providing additional definitions for SQL operators The method does not provide.

And, for your purpose, you should use manual pages to get the list of things you care about.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -