QCubed Query Conditions

All QCubed Query method calls require a QQ Condition. QQ Conditions allow you to create a nested/hierarchical set of conditions to describe what essentially becomes your WHERE clause in a SQL query statement.

The following is the list of QQ Condition classes and what parameters they take:
  • QQ::All()
  • QQ::None()
  • QQ::Equal(QQNode, Value)
  • QQ::NotEqual(QQNode, Value)
  • QQ::GreaterThan(QQNode, Value)
  • QQ::LessThan(QQNode, Value)
  • QQ::GreaterOrEqual(QQNode, Value)
  • QQ::LessOrEqual(QQNode, Value)
  • QQ::IsNull(QQNode)
  • QQ::IsNotNull(QQNode)
  • QQ::In(QQNode, array of string/int/datetime)
  • QQ::Like(QQNode, string)
For almost all of the above QQ Conditions, you are comparing a column with some value. The QQ Node parameter represents that column. However, value can be either a static value (like an integer, a string, a datetime, etc.) or it can be another QQ Node.

And finally, there are three special QQ Condition classes which take in any number of additional QQ Condition classes:
  • QQ::AndCondition()
  • QQ::OrCondition()
  • QQ::Not() - "Not" can only take in one QQ Condition class
(conditions can be passed in as parameters and/or as arrays)

Because And/Or/Not conditions can take in any other condition, including other And/Or/Not conditions, you can embed these conditions into other conditions to create what ends up being a logic tree for your entire SQL Where clause. See below for more information on this.

Select all People where: the first name is alphabetically "greater than" the last name

kavita 2 arulyfred
Ben 5665564
Mike Ho
Wendy Smith
Samantha Jones
Linda Brady
sdhgfhsdg jai
Nice Job

Select all Projects where: the manager's first name is alphabetically "greater than" the last name, or who's name contains "Website"

ACME Website Redesign (managed by Karen Wolfe)
Blah (managed by Mike Ho)
Blueman Industrial Site Architecture (managed by kavita 2 arulyfred)

Select all Projects where: the Project ID <= 2 AND (the manager's first name is alphabetically "greater than" the last name, or who's name contains "Website")

ACME Website Redesign (managed by Karen Wolfe)
Blah (managed by Mike Ho)