All Products
Search
Document Center

Hologres:Subquery functions

Last Updated:Dec 02, 2024

Hologres is compatible with PostgreSQL and allows you to use standard PostgreSQL syntax for data development.

The following table describes the subquery functions that are supported by Hologres. Hologres supports a subset of PostgreSQL functions. For information about how to use the following subquery functions, see Subquery Expressions.
FunctionDescription
EXISTS (subquery)Checks whether a subquery returns rows.
  • If at least one row is returned, this function returns t that indicates true.
  • If no row is returned, this function returns f that indicates false.
Note A subquery is a SELECT statement.
IN (subquery)Compares entries row by row to check whether the values produced by an expression are included in the result returned by a subquery.
  • If a value produced by the expression is a member of the result returned by the subquery, this function returns t that indicates true.
  • If no value produced by the expression is a member of the result returned by the subquery, this function returns f that indicates false.
Note The number of values that the expression produces each time must be the same as the number of columns in the result returned by the subquery.
NOT IN (subquery)Compares entries row by row to check whether the values produced by an expression are excluded from the result returned by a subquery.
  • If no value produced by the expression is a member of the result returned by the subquery, this function returns t that indicates true.
  • If a value produced by the expression is a member of the result returned by the subquery, this function returns f that indicates false.
Note The number of values that the expression produces each time must be the same as the number of columns in the result returned by the subquery.
ANY (subquery)Compares the values produced by an expression with the result returned by a subquery row by row by using a specified operator.
  • If one or more operations return t, this function returns t that indicates true.
  • If all operations return f, this function returns f that indicates false.
Note The number of values that the expression produces each time must be the same as the number of columns in the result returned by the subquery.
SOME (subquery)Compares the values produced by an expression with the result returned by a subquery row by row by using a specified operator.
  • If one or more operations return t, this function returns t that indicates true.
  • If all operations return f, this function returns f that indicates false.
Note The number of values that the expression produces each time must be the same as the number of columns in the result returned by the subquery.