NAME

SQL::Builder::Having - Represent SQL's HAVING clause

SYNOPSIS

This class can represent the following SQL:

HAVING expr

Here's the gist of it:

my $having = SQL::Builder::Having->new;

$having->expr->list_push('COUNT(*) > 5');

# HAVING COUNT(*) > 5
print $having->sql;

$having->expr->list_push('COUNT(*) < 10');

# HAVING COUNT(*) > 5 AND COUNT(*) < 10
print $having->sql

DESCRIPTION

This is a SQL::Builder::Base(3) subclass

METHODS

expr()

Get/set the expr. Called with arguments sets the current expression and returns the current object. If no arguments are passed, the current expression is returned. By default, this method is populated with a SQL::Builder::BinaryOp(3) object

init()

This calls SQL::Builder::Base::init and populates expr() with a default vaule

sql()

Returns an empty string if the value returned by expr() is defined and has a length. The value of expr() is passed through SQL::Builder::Base::dosql()

children()

Return a SQL::Builder::Iterator object to iterate over the value of expr()

SEE ALSO

SQL::Builder::Base(3) SQL::Builder::BinaryOp(3)