I have a query that gives me the start and end of each user, but what I want is to omit two users in specific, how can I manage to omit two results?
I have the following query:
SELECT
nombre, MIN(fecha) desde, MAX(fecha) hasta
FROM
tnames
WHERE
fecha > '2014%'
AND nombre IN (SELECT DISTINCT
nombre
FROM
tnames
WHERE fecha > '2014%') GROUP BY nombre
Result:
-----------------------------------
nombre | desde | hasta
-----------------------------------
luis | 2016-07-01 | 2016-08-01
marco | 2017-01-01 | 2017-04-25
juan | 2016-01-05 | 2016-02-20
pedro | 2016-04-15 | 2016-01-02
mario | 2016-03-05 | 2017-03-03
How could I get the following that does not appear in my result the names of Marco and Pedro :
-----------------------------------
nombre | desde | hasta
-----------------------------------
luis | 2016-07-01 | 2016-08-01
juan | 2016-01-05 | 2016-02-20
mario | 2016-03-05 | 2017-03-03