Class SQLExpressions

java.lang.Object
com.querydsl.sql.SQLExpressions

public final class SQLExpressions extends Object
Common SQL expressions
Author:
tiwe
  • Field Details

    • all

      public static final Expression<Object[]> all
      Wildcard expression
    • countAll

      public static final Expression<Long> countAll
      Wildcard count expression
  • Method Details

    • set

      public static <T> Expression<T> set(Path<T> target, Expression<? extends T> value)
      Create an assignment expression
      Type Parameters:
      T -
      Parameters:
      target - target expression
      value - value to be set
      Returns:
      target = value
    • set

      public static <T> Expression<T> set(Path<T> target, T value)
      Create an assignment expression
      Type Parameters:
      T -
      Parameters:
      target - target expression
      value - value to be set
      Returns:
      target = value
    • select

      public static <T> SQLQuery<T> select(Expression<T> expr)
      Create a new detached SQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - projection
      Returns:
      select(expr)
    • select

      public static SQLQuery<Tuple> select(Expression<?>... exprs)
      Create a new detached SQLQuery instance with the given projection
      Parameters:
      exprs - projection
      Returns:
      select(exprs)
    • selectDistinct

      public static <T> SQLQuery<T> selectDistinct(Expression<T> expr)
      Create a new detached SQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - distinct projection
      Returns:
      select(distinct expr)
    • selectDistinct

      public static SQLQuery<Tuple> selectDistinct(Expression<?>... exprs)
      Create a new detached SQLQuery instance with the given projection
      Parameters:
      exprs - distinct projection
      Returns:
      select(distinct exprs)
    • selectZero

      public static SQLQuery<Integer> selectZero()
      Create a new detached SQLQuery instance with zero as the projection
      Returns:
      select(0)
    • selectOne

      public static SQLQuery<Integer> selectOne()
      Create a new detached SQLQuery instance with one as the projection
      Returns:
      select(1)
    • selectFrom

      public static <T> SQLQuery<T> selectFrom(RelationalPath<T> expr)
      Create a new detached SQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - query source and projection
      Returns:
      select(expr).from(expr)
    • union

      public static <T> Union<T> union(SubQueryExpression<T>... sq)
      Create a new UNION clause
      Type Parameters:
      T -
      Parameters:
      sq - subqueries
      Returns:
      union
    • union

      public static <T> Union<T> union(List<SubQueryExpression<T>> sq)
      Create a new UNION clause
      Type Parameters:
      T -
      Parameters:
      sq - subqueries
      Returns:
      union
    • unionAll

      public static <T> Union<T> unionAll(SubQueryExpression<T>... sq)
      Create a new UNION ALL clause
      Type Parameters:
      T -
      Parameters:
      sq - subqueries
      Returns:
      union
    • unionAll

      public static <T> Union<T> unionAll(List<SubQueryExpression<T>> sq)
      Create a new UNION ALL clause
      Type Parameters:
      T -
      Parameters:
      sq - subqueries
      Returns:
      union
    • any

      public static BooleanExpression any(BooleanExpression expr)
      Get an aggregate any expression for the given boolean expression
    • all

      public static BooleanExpression all(BooleanExpression expr)
      Get an aggregate all expression for the given boolean expression
    • relationalFunctionCall

      public static <T> RelationalFunctionCall<T> relationalFunctionCall(Class<? extends T> type, String function, Object... args)
      Create a new RelationalFunctionCall for the given function and arguments
      Type Parameters:
      T -
      Parameters:
      type - type
      function - function name
      args - arguments
      Returns:
      relational function call
    • nextval

      public static SimpleExpression<Long> nextval(String sequence)
      Create a nextval(sequence) expression

      Returns the next value from the give sequence

      Parameters:
      sequence - sequence name
      Returns:
      nextval(sequence)
    • nextval

      public static <T extends Number> SimpleExpression<T> nextval(Class<T> type, String sequence)
      Create a nextval(sequence) expression of the given type

      Returns the next value from the given sequence

      Parameters:
      type - type of call
      sequence - sequence name
      Returns:
      nextval(sequence)
    • date

      public static <D extends Comparable> DateExpression<D> date(DateTimeExpression<D> dateTime)
      Convert timestamp to date
      Parameters:
      dateTime - timestamp
      Returns:
      date
    • date

      public static <D extends Comparable> DateExpression<D> date(Class<D> type, DateTimeExpression<?> dateTime)
      Convert timestamp to date
      Parameters:
      type - type
      dateTime - timestamp
      Returns:
      date
    • dateadd

      public static <D extends Comparable> DateTimeExpression<D> dateadd(DatePart unit, DateTimeExpression<D> date, int amount)
      Create a dateadd(unit, date, amount) expression
      Parameters:
      unit - date part
      date - date
      amount - amount
      Returns:
      converted date
    • dateadd

      public static <D extends Comparable> DateExpression<D> dateadd(DatePart unit, DateExpression<D> date, int amount)
      Create a dateadd(unit, date, amount) expression
      Parameters:
      unit - date part
      date - date
      amount - amount
      Returns:
      converted date
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, DateExpression<D> start, DateExpression<D> end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, D start, DateExpression<D> end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, DateExpression<D> start, D end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, DateTimeExpression<D> start, DateTimeExpression<D> end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, D start, DateTimeExpression<D> end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datediff

      public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit, DateTimeExpression<D> start, D end)
      Get a datediff(unit, start, end) expression
      Parameters:
      unit - date part
      start - start
      end - end
      Returns:
      difference in units
    • datetrunc

      public static <D extends Comparable> DateExpression<D> datetrunc(DatePart unit, DateExpression<D> expr)
      Truncate the given date expression
      Parameters:
      unit - date part to truncate to
      expr - truncated date
    • datetrunc

      public static <D extends Comparable> DateTimeExpression<D> datetrunc(DatePart unit, DateTimeExpression<D> expr)
      Truncate the given datetime expression
      Parameters:
      unit - datepart to truncate to
      expr - truncated datetime
    • addYears

      public static <D extends Comparable> DateTimeExpression<D> addYears(DateTimeExpression<D> date, int years)
      Add the given amount of years to the date
      Parameters:
      date - datetime
      years - years to add
      Returns:
      converted datetime
    • addMonths

      public static <D extends Comparable> DateTimeExpression<D> addMonths(DateTimeExpression<D> date, int months)
      Add the given amount of months to the date
      Parameters:
      date - datetime
      months - months to add
      Returns:
      converted datetime
    • addWeeks

      public static <D extends Comparable> DateTimeExpression<D> addWeeks(DateTimeExpression<D> date, int weeks)
      Add the given amount of weeks to the date
      Parameters:
      date - datetime
      weeks - weeks to add
      Returns:
      converted date
    • addDays

      public static <D extends Comparable> DateTimeExpression<D> addDays(DateTimeExpression<D> date, int days)
      Add the given amount of days to the date
      Parameters:
      date - datetime
      days - days to add
      Returns:
      converted datetime
    • addHours

      public static <D extends Comparable> DateTimeExpression<D> addHours(DateTimeExpression<D> date, int hours)
      Add the given amount of hours to the date
      Parameters:
      date - datetime
      hours - hours to add
      Returns:
      converted datetime
    • addMinutes

      public static <D extends Comparable> DateTimeExpression<D> addMinutes(DateTimeExpression<D> date, int minutes)
      Add the given amount of minutes to the date
      Parameters:
      date - datetime
      minutes - minutes to add
      Returns:
      converted datetime
    • addSeconds

      public static <D extends Comparable> DateTimeExpression<D> addSeconds(DateTimeExpression<D> date, int seconds)
      Add the given amount of seconds to the date
      Parameters:
      date - datetime
      seconds - seconds to add
      Returns:
      converted datetime
    • addYears

      public static <D extends Comparable> DateExpression<D> addYears(DateExpression<D> date, int years)
      Add the given amount of years to the date
      Parameters:
      date - date
      years - years to add
      Returns:
      converted date
    • addMonths

      public static <D extends Comparable> DateExpression<D> addMonths(DateExpression<D> date, int months)
      Add the given amount of months to the date
      Parameters:
      date - date
      months - months to add
      Returns:
      converted date
    • addWeeks

      public static <D extends Comparable> DateExpression<D> addWeeks(DateExpression<D> date, int weeks)
      Add the given amount of weeks to the date
      Parameters:
      date - date
      weeks - weeks to add
      Returns:
      converted date
    • addDays

      public static <D extends Comparable> DateExpression<D> addDays(DateExpression<D> date, int days)
      Add the given amount of days to the date
      Parameters:
      date - date
      days - days to add
      Returns:
      converted date
    • sum

      public static <T extends Number> WindowOver<T> sum(Expression<T> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      sum(expr)
    • count

      public static WindowOver<Long> count()
      Start a window function expression
      Returns:
      count()
    • count

      public static WindowOver<Long> count(Expression<?> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      count(expr)
    • countDistinct

      public static WindowOver<Long> countDistinct(Expression<?> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      count(distinct expr)
    • avg

      public static <T extends Number> WindowOver<T> avg(Expression<T> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      avg(expr)
    • min

      public static <T extends Comparable> WindowOver<T> min(Expression<T> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      min(expr)
    • max

      public static <T extends Comparable> WindowOver<T> max(Expression<T> expr)
      Start a window function expression
      Parameters:
      expr - expression
      Returns:
      max(expr)
    • lead

      public static <T> WindowOver<T> lead(Expression<T> expr)
      expr evaluated at the row that is one row after the current row within the partition;
      Parameters:
      expr - expression
      Returns:
      lead(expr)
    • lag

      public static <T> WindowOver<T> lag(Expression<T> expr)
      expr evaluated at the row that is one row before the current row within the partition
      Parameters:
      expr - expression
      Returns:
      lag(expr)
    • listagg

      public static WithinGroup<String> listagg(Expression<?> expr, String delimiter)
      LISTAGG orders data within each group specified in the ORDER BY clause and then concatenates the values of the measure column.
      Parameters:
      expr - measure column
      delimiter - delimiter
      Returns:
      listagg(expr, delimiter)
    • nthValue

      public static <T> WindowOver<T> nthValue(Expression<T> expr, Number n)
      NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr.
      Parameters:
      expr - measure expression
      n - one based row index
      Returns:
      nth_value(expr, n)
    • nthValue

      public static <T> WindowOver<T> nthValue(Expression<T> expr, Expression<? extends Number> n)
      NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr
      Parameters:
      expr - measure expression
      n - one based row index
      Returns:
      nth_value(expr, n)
    • ntile

      public static <T extends Number & Comparable> WindowOver<T> ntile(T num)
      divides an ordered data set into a number of buckets indicated by expr and assigns the appropriate bucket number to each row
      Parameters:
      num - bucket size
      Returns:
      ntile(num)
    • rank

      public static WindowOver<Long> rank()
      rank of the current row with gaps; same as row_number of its first peer
      Returns:
      rank()
    • rank

      public static WithinGroup<Long> rank(Object... args)
      As an aggregate function, RANK calculates the rank of a hypothetical row identified by the arguments of the function with respect to a given sort specification. The arguments of the function must all evaluate to constant expressions within each aggregate group, because they identify a single row within each group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore, the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      rank(args)
    • rank

      public static WithinGroup<Long> rank(Expression<?>... args)
      As an aggregate function, RANK calculates the rank of a hypothetical row identified by the arguments of the function with respect to a given sort specification. The arguments of the function must all evaluate to constant expressions within each aggregate group, because they identify a single row within each group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore, the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      rank(args)
    • denseRank

      public static WindowOver<Long> denseRank()
      rank of the current row without gaps; this function counts peer groups
      Returns:
      dense_rank()
    • denseRank

      public static WithinGroup<Long> denseRank(Object... args)
      As an aggregate function, DENSE_RANK calculates the dense rank of a hypothetical row identified by the arguments of the function with respect to a given sort specification. The arguments of the function must all evaluate to constant expressions within each aggregate group, because they identify a single row within each group. The constant argument expressions and the expressions in the order_by_clause of the aggregate match by position. Therefore, the number of arguments must be the same and types must be compatible.
      Parameters:
      args - arguments
      Returns:
      dense_rank(args)
    • denseRank

      public static WithinGroup<Long> denseRank(Expression<?>... args)
      As an aggregate function, DENSE_RANK calculates the dense rank of a hypothetical row identified by the arguments of the function with respect to a given sort specification. The arguments of the function must all evaluate to constant expressions within each aggregate group, because they identify a single row within each group. The constant argument expressions and the expressions in the order_by_clause of the aggregate match by position. Therefore, the number of arguments must be the same and types must be compatible.
      Parameters:
      args - arguments
      Returns:
      dense_rank(args)
    • percentRank

      public static WindowOver<Double> percentRank()
      As an analytic function, for a row r, PERCENT_RANK calculates the rank of r minus 1, divided by 1 less than the number of rows being evaluated (the entire query result set or a partition).
      Returns:
      percent_rank()
    • percentRank

      public static WithinGroup<Double> percentRank(Object... args)
      As an aggregate function, PERCENT_RANK calculates, for a hypothetical row r identified by the arguments of the function and a corresponding sort specification, the rank of row r minus 1 divided by the number of rows in the aggregate group. This calculation is made as if the hypothetical row r were inserted into the group of rows over which Oracle Database is to aggregate. The arguments of the function identify a single hypothetical row within each aggregate group. Therefore, they must all evaluate to constant expressions within each aggregate group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      percent_rank(args)
    • percentRank

      public static WithinGroup<Double> percentRank(Expression<?>... args)
      As an aggregate function, PERCENT_RANK calculates, for a hypothetical row r identified by the arguments of the function and a corresponding sort specification, the rank of row r minus 1 divided by the number of rows in the aggregate group. This calculation is made as if the hypothetical row r were inserted into the group of rows over which Oracle Database is to aggregate. The arguments of the function identify a single hypothetical row within each aggregate group. Therefore, they must all evaluate to constant expressions within each aggregate group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      percent_rank(args)
    • percentileCont

      public static <T extends Number> WithinGroup<T> percentileCont(T arg)
      Calculates a percentile based on a continuous distribution of the column value
      Parameters:
      arg - argument
      Returns:
      percentile_cont(arg)
    • percentileCont

      public static <T extends Number> WithinGroup<T> percentileCont(Expression<T> arg)
      Calculates a percentile based on a continuous distribution of the column value
      Parameters:
      arg - argument
      Returns:
      percentile_cont(arg)
    • percentileDisc

      public static <T extends Number> WithinGroup<T> percentileDisc(T arg)
      PERCENTILE_DISC is an inverse distribution function that assumes a discrete distribution model. It takes a percentile value and a sort specification and returns an element from the set. Nulls are ignored in the calculation.

      This function takes as an argument any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. The function returns the same datatype as the numeric datatype of the argument.

      Parameters:
      arg - argument
      Returns:
      percentile_disc(arg)
    • percentileDisc

      public static <T extends Number> WithinGroup<T> percentileDisc(Expression<T> arg)
      PERCENTILE_DISC is an inverse distribution function that assumes a discrete distribution model. It takes a percentile value and a sort specification and returns an element from the set. Nulls are ignored in the calculation.

      This function takes as an argument any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. The function returns the same datatype as the numeric datatype of the argument.

      Parameters:
      arg - argument
      Returns:
      percentile_disc(arg)
    • regrSlope

      public static WindowOver<Double> regrSlope(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_SLOPE returns the slope of the line
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_slope(arg1, arg2)
    • regrIntercept

      public static WindowOver<Double> regrIntercept(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_INTERCEPT returns the y-intercept of the regression line.
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_intercept(arg1, arg2)
    • regrCount

      public static WindowOver<Double> regrCount(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_COUNT returns an integer that is the number of non-null number pairs used to fit the regression line.
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_count(arg1, arg2)
    • regrR2

      public static WindowOver<Double> regrR2(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_R2 returns the coefficient of determination (also called R-squared or goodness of fit) for the regression.
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_r2(arg1, arg2)
    • regrAvgx

      public static WindowOver<Double> regrAvgx(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_AVGX evaluates the average of the independent variable (arg2) of the regression line.
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_avgx(arg1, arg2)
    • regrAvgy

      public static WindowOver<Double> regrAvgy(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_AVGY evaluates the average of the dependent variable (arg1) of the regression line.
      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_avgy(arg1, arg2)
    • regrSxx

      public static WindowOver<Double> regrSxx(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_SXX makes the following computation after the elimination of null (arg1, arg2) pairs:

      REGR_COUNT(arg1, arg2) * VAR_POP(arg2)

      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_sxx(arg1, arg2)
    • regrSyy

      public static WindowOver<Double> regrSyy(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_SYY makes the following computation after the elimination of null (arg1, arg2) pairs:

      REGR_COUNT(arg1, arg2) * VAR_POP(arg1)

      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_syy(arg1, arg2)
    • regrSxy

      public static WindowOver<Double> regrSxy(Expression<? extends Number> arg1, Expression<? extends Number> arg2)
      REGR_SXY makes the following computation after the elimination of null (arg1, arg2) pairs:

      REGR_COUNT(arg1, arg2) * COVAR_POP(arg1, arg2)

      Parameters:
      arg1 - first arg
      arg2 - second arg
      Returns:
      regr_sxy(arg1, arg2)
    • cumeDist

      public static WindowOver<Double> cumeDist()
      CUME_DIST calculates the cumulative distribution of a value in a group of values.
      Returns:
      cume_dist()
    • cumeDist

      public static WithinGroup<Double> cumeDist(Object... args)
      As an aggregate function, CUME_DIST calculates, for a hypothetical row r identified by the arguments of the function and a corresponding sort specification, the relative position of row r among the rows in the aggregation group. Oracle makes this calculation as if the hypothetical row r were inserted into the group of rows to be aggregated over. The arguments of the function identify a single hypothetical row within each aggregate group. Therefore, they must all evaluate to constant expressions within each aggregate group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore, the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      cume_dist(args)
    • cumeDist

      public static WithinGroup<Double> cumeDist(Expression<?>... args)
      As an aggregate function, CUME_DIST calculates, for a hypothetical row r identified by the arguments of the function and a corresponding sort specification, the relative position of row r among the rows in the aggregation group. Oracle makes this calculation as if the hypothetical row r were inserted into the group of rows to be aggregated over. The arguments of the function identify a single hypothetical row within each aggregate group. Therefore, they must all evaluate to constant expressions within each aggregate group. The constant argument expressions and the expressions in the ORDER BY clause of the aggregate match by position. Therefore, the number of arguments must be the same and their types must be compatible.
      Parameters:
      args - arguments
      Returns:
      cume_dist(args)
    • corr

      public static WindowOver<Double> corr(Expression<? extends Number> expr1, Expression<? extends Number> expr2)
      CORR returns the coefficient of correlation of a set of number pairs.
      Parameters:
      expr1 - first arg
      expr2 - second arg
      Returns:
      corr(expr1, expr2)
    • covarPop

      public static WindowOver<Double> covarPop(Expression<? extends Number> expr1, Expression<? extends Number> expr2)
      CORR returns the coefficient of correlation of a set of number pairs.
      Parameters:
      expr1 - first arg
      expr2 - second arg
      Returns:
      corr(expr1, expr2)
    • covarSamp

      public static WindowOver<Double> covarSamp(Expression<? extends Number> expr1, Expression<? extends Number> expr2)
      CORR returns the coefficient of correlation of a set of number pairs.
      Parameters:
      expr1 - first arg
      expr2 - second arg
      Returns:
      corr(expr1, expr2)
    • ratioToReport

      public static <T> WindowOver<T> ratioToReport(Expression<T> expr)
      computes the ratio of a value to the sum of a set of values. If expr evaluates to null, then the ratio-to-report value also evaluates to null.
      Returns:
      ratio_to_report(expr)
    • rowNumber

      public static WindowOver<Long> rowNumber()
      number of the current row within its partition, counting from 1
      Returns:
      row_number()
    • stddev

      public static <T extends Number> WindowOver<T> stddev(Expression<T> expr)
      returns the sample standard deviation of expr, a set of numbers.
      Parameters:
      expr - argument
      Returns:
      stddev(expr)
    • stddevDistinct

      public static <T extends Number> WindowOver<T> stddevDistinct(Expression<T> expr)
      returns the sample standard deviation of expr, a set of numbers.
      Parameters:
      expr - argument
      Returns:
      stddev(distinct expr)
    • stddevPop

      public static <T extends Number> WindowOver<T> stddevPop(Expression<T> expr)
      returns the population standard deviation and returns the square root of the population variance.
      Parameters:
      expr - argument
      Returns:
      stddev_pop(expr)
    • stddevSamp

      public static <T extends Number> WindowOver<T> stddevSamp(Expression<T> expr)
      returns the cumulative sample standard deviation and returns the square root of the sample variance.
      Parameters:
      expr - argument
      Returns:
      stddev_samp(expr)
    • variance

      public static <T extends Number> WindowOver<T> variance(Expression<T> expr)
      returns the variance of expr
      Parameters:
      expr - argument
      Returns:
      variance(expr)
    • varPop

      public static <T extends Number> WindowOver<T> varPop(Expression<T> expr)
      returns the population variance of a set of numbers after discarding the nulls in this set.
      Parameters:
      expr - argument
      Returns:
      var_pop(expr)
    • varSamp

      public static <T extends Number> WindowOver<T> varSamp(Expression<T> expr)
      returns the sample variance of a set of numbers after discarding the nulls in this set.
      Parameters:
      expr - argument
      Returns:
      var_samp(expr)
    • firstValue

      public static <T> WindowOver<T> firstValue(Expression<T> expr)
      returns value evaluated at the row that is the first row of the window frame
      Parameters:
      expr - argument
      Returns:
      first_value(expr)
    • lastValue

      public static <T> WindowOver<T> lastValue(Expression<T> expr)
      returns value evaluated at the row that is the last row of the window frame
      Parameters:
      expr - argument
      Returns:
      last_value(expr)
    • left

      public static StringExpression left(Expression<String> lhs, int rhs)
      Get the rhs leftmost characters of lhs
      Parameters:
      lhs - string
      rhs - character amount
      Returns:
      rhs leftmost characters
    • right

      public static StringExpression right(Expression<String> lhs, int rhs)
      Get the rhs rightmost characters of lhs
      Parameters:
      lhs - string
      rhs - character amount
      Returns:
      rhs rightmost characters
    • left

      public static StringExpression left(Expression<String> lhs, Expression<Integer> rhs)
      Get the rhs leftmost characters of lhs
      Parameters:
      lhs - string
      rhs - character amount
      Returns:
      rhs leftmost characters
    • right

      public static StringExpression right(Expression<String> lhs, Expression<Integer> rhs)
      Get the rhs leftmost characters of lhs
      Parameters:
      lhs - string
      rhs - character amount
      Returns:
      rhs rightmost characters
    • groupConcat

      public static StringExpression groupConcat(Expression<String> expr)
      Get a group_concat(expr) expression
      Parameters:
      expr - expression to be aggregated
      Returns:
      group_concat(expr)
    • groupConcat

      public static StringExpression groupConcat(Expression<String> expr, String separator)
      Get a group_concat(expr, separator) expression
      Parameters:
      expr - expression to be aggregated
      separator - separator string
      Returns:
      group_concat(expr, separator)