Delete repeated records in a select in Mysql

0

I have the following select

SELECT correo_persona
FROM tb_extintores
INNER JOIN tb_cliente_normal
ON rut_cliente = rut_persona
WHERE fecha_vencimiento BETWEEN '2018-09-11' AND '2018-12-11'

that brings back customer emails. but sometimes the same customer's email is repeated more than 1 time and I need only one email per client to be extracted.

    
asked by sebastian bizama inostroza 29.11.2017 в 17:22
source

1 answer

3
SELECT DISTINCT correo_persona 
FROM tb_extintores 
INNER JOIN tb_cliente_normal 
ON rut_cliente= rut_persona 
WHERE fecha_vencimiento BETWEEN '2018-09-11' AND '2018-12-11'

By DISTINCT we will get only 1 value for each repetition.

  

Source: link

    
answered by 29.11.2017 / 17:24
source