Good, I have a little problem to see if you can help me.
I start from the following query
SELECT Caja, Oficina, DNI, NombreCompleto, Importe
FROM miTabla
WHERE Importe > 50 and Caja LIKE '0%'
What they ask me now is to group it so that it takes the first full name of each box-office The query would return those three fields: Box / office / full name (the first)
So what I've done is:
SELECT Caja, Oficina, NombreCompleto
FROM(
SELECT Caja, Oficina, DNI, NombreCompleto, Importe
FROM movimientos
WHERE Importe > 50 and Caja LIKE '0%') as miTabla
GROUP BY Caja, Oficina, NombreCompleto
But he takes out all the records and I just want the first of each box and office alphabetically speaking.