sql >> Base de Datos >  >> RDS >> Mysql

Consulta de unión mysql filas duplicadas

Solución alterna. Podrías usar:

SELECT username, pic0 
FROM ".$table." 
WHERE ( username LIKE '%lunch%' ) 
   OR ( username IS NOT NULL 
      AND age BETWEEN 28 AND 45 
      AND willingness LIKE '%lunch%' 
      )
ORDER BY ( username LIKE '%lunch%' ) DESC