Skip to content
Permalink
Browse files

MDL-58754 competency: Change query for DISTINCT COUNT

  • Loading branch information...
andrewnicols committed May 2, 2017
1 parent 75528e9 commit 0c4220fba54f0c25cde3d083bd3075e54d5dd6bd
Showing with 2 additions and 1 deletion.
  1. +2 −1 competency/classes/competency.php
@@ -676,7 +676,8 @@ protected function validate_scaleconfiguration($value) {
public static function share_same_framework(array $ids) {
global $DB;
list($insql, $params) = $DB->get_in_or_equal($ids);
return $DB->count_records_select(self::TABLE, "id $insql", $params, "COUNT(DISTINCT(competencyframeworkid))") == 1;
$sql = "SELECT COUNT('x') FROM (SELECT DISTINCT(competencyframeworkid) FROM {" . self::TABLE . "} WHERE id {$insql}) f";
return $DB->count_records_sql($sql, $params) == 1;
}
/**

0 comments on commit 0c4220f

Please sign in to comment.
You can’t perform that action at this time.