db_distinct_field($table, $field, $query)
drupal/includes/database/database.inc, line 1858
Wraps the given table.field entry with a DISTINCT(). The wrapper is added to the SELECT list entry of the given query and the resulting query is returned. This function only applies the wrapper if a DISTINCT doesn't already exist in the query.
@todo Remove this.
$table Table containing the field to set as DISTINCT
$field Field to set as DISTINCT
$query Query to apply the wrapper to
SQL query with the DISTINCT wrapper surrounding the given table.field.
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
function db_distinct_field($table, $field, $query) {
return Database::getActiveConnection()->distinctField($table, $field, $query);
}