Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View Page History
{code}
{card}
{deck}

{deck:id=UseCase3}
{card:label=Use-Case 8: Aggregation Example}
{code}
$select->columns(array("country", $select->fn()->sum("population")))
->from('cities')
->group('country');

// SELECT cities.country, SUM(cities.population)
// FROM cities
// GROUP BY cities.country
{code}
{card}

{card:label=Use-Case 9: String Example}
{code}
$select->columns($select->fn()->substr("firstname", 0, 1), $select->fn()->count())
->from('persons');
->group($select->fn()->substr("firstname", 0, 1));

// SELECT SUBSTRING(persons.firstname, 0, 1), count(*)
// FROM persons
// GROUP BY SUBSTRING(persons.firstname, 0, 1)
{code}
{card}

{card:label=Use-Case 10: Comparison Operators}
{code}
$select->from("persons")
->where($select->fn()->eq("name", $name))
->where($select->fn()->gt("age", $greaterThanAge))
->where($select->fn()->in("eyeColor", array("blue", "green"))
->where($select->fn()->between("salary", 20000, 50000);
{code}
{card}
{deck}

{zone-data}