Sql získat jedinečné hodnoty

Příklady kódu

13
0

N

SELECT COUNT (DISTINCT column-name)  FROM table-name
12
0

N

SELECT DISTINCT column1, column2, ...

 FROM table_name; 
5
0

N

SELECT DISTINCT Column_name FROM table_name;
1
0

N

SELECT a.*
FROM emails a
INNER JOIN 
  (SELECT email,
    MIN(id) as id
  FROM emails 
  GROUP BY email 
) AS b
  ON a.email = b.email 
  AND a.id = b.id;
0
0

N

DISTINCT
- select distinct * from employees; ==> retrieves any row if it has at
least a single unique column.
- select distinct first_name from employees; ==> retrieves unique names
from table. (removes duplicates)
- select distinct count(*) from employees; retrieve number of unique rows
if any row has at least a single unique data.
0
0

N

DISTINCT
- select distinct * from employees; ==> 
  retrieves any row if it has at
  least a single unique column.

- select distinct first_name from employees; ==> 
      retrieves unique names
     from table. (removes duplicates)
     
- select distinct count(*) from employees;
     retrieve number of unique rows
     if any row has at least a single unique data.

V jiných jazycích

Tato stránka je v jiných jazycích

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................