db_distinct_field

  1. drupal
    1. drupal6 database.inc
    2. drupal7
Versionen
drupal6 – drupal7 db_distinct_field($table, $field, $query)

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.

Übergabeparameter

$table Table containing the field to set as DISTINCT

$field Field to set as DISTINCT

$query Query to apply the wrapper to

Rückgabewert

SQL query with the DISTINCT wrapper surrounding the given table.field.

Verwandte Themen

▾ 1 function calls db_distinct_field()

db_rewrite_sql in includes/database/database.inc
Rewrites node, taxonomy and comment queries. Use it for listing queries. Do not use FROM table1, table2 syntax, use JOIN instead.

Code

includes/database/database.inc, line 2055

<?php
function db_distinct_field($table, $field, $query) {
  return Database::getConnection()->distinctField($table, $field, $query);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen