Example #1
0
func TestHaving(t *testing.T) {
	having := nodes.Having(1)
	expected := "HAVING 1"
	if got, _ := sql.Accept(having); expected != got {
		t.Errorf("TestHaving was expected to return %s, got %s", expected, got)
	}
}
Example #2
0
// Sets the Context's Having member to the given expression.
func (self *SelectManager) Having(expr interface{}) *SelectManager {
	if _, ok := expr.(string); ok {
		expr = nodes.Literal(expr)
	}

	self.Context.Having = nodes.Having(expr)
	return self
}