I have this table (centrodb.InfoColaboradores) which has the ids of all the other tables that I make the join
in the database with this data:
I have this query:
SELECT B.NomeColaborador,
C.Ala,
D.Grupo,
E.Turno
FROM centrodb.RelacaoColab AS A LEFT OUTER JOIN centrodb.InfoColaboradores AS B
ON B.Id = A.IdColab LEFT OUTER JOIN centrodb.TiposAlas AS C
ON C.Id = A.IdAla LEFT OUTER JOIN centrodb.TiposGrupos AS D
ON D.Id = A.IdGrup LEFT OUTER JOIN centrodb.H_Turno AS E
ON E.Id = A.IdTurn
WHERE E.Turno = 'M' ORDER BY RAND() LIMIT 8
How do I not get repeated these situations when generating the 8 employees of the 11 that I have in the database table?