mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-58754 competency: Change query for DISTINCT COUNT
This commit is contained in:
parent
06e3b6d8ba
commit
458e5f66c2
@ -676,7 +676,8 @@ class competency extends persistent {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user