Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Wiki Markup
Returns the count of all values respecting the parameters given in the expression.
Syntax:
SELECT COUNT(\[DISTINCT\] column \[WHERE filtercolumn=value_to_test OR filtercolumn=another_value_to_test\]) FROM table
Examples:
/* returns the number of distinct id's from the table transactions */SELECT COUNT(DISTINCT id) FROM transactions    /* returns the number of distinct ids in column one and the number of distinct ids where the column chain=2 please note that this expression can be used in the datamodeler by simply typing the WHERE clause after the columnname. */  SELECT COUNT(DISTINCT id) AS distinctids, COUNT(DISTINCT id WHERE chain=2) AS distinctidchain2 FROM transactions.
 \\