all-things-risingwave

What does 'SELECT true AS true;' do in SQL?

I don’t understand what this SQL statement does. Can someone explain its purpose and functionality?

ji

jie

Asked on May 20, 2022

  • The SQL statement 'SELECT true AS true;' is used to create an alias for the boolean value 'true'.
  • It assigns the alias 'true' to the boolean value 'true', essentially renaming it in the result set.
  • This statement is valid in SQL and can be used to demonstrate the concept of aliasing in SQL queries.

Example:

SELECT true AS true;

Output: | true | |------| | true |

May 20, 2022Edited by