Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

why DISTINCT it is not working

Por que no funciona el distinct
SELECT DISTINCT G.IDGERENCIA, GS.AREA
  FROM TA_GASTOS_STAGE GS
       INNER JOIN TA_GERENCIA G ON GS.GERENCIA_DIRECCIÓN = G.NOMBREGERENCIA
WHERE
       GS.AREA LIKE '%Mantenimiento Palmas%'  
ORDER BY G.IDGERENCIA,GS.AREA

         IDGERENCIA      AREA
1      11      Mantenimiento Palmas
2      11      Mantenimiento Palmas

this is the table_stage
SELECT *
  FROM TA_GASTOS_STAGE GS
WHERE
       GS.AREA LIKE '%Mantenimiento Palmas%'  
         TIPO      CECO      DESCRIPCION_CECO      F4      GERENCIA_DIRECCIÓN      AREA      PLANTA      RESPONSABLE      F9      F10      F11      F12      F13      F14      F15      F16
1      Producción      10P30803      Soplado Palmas Supervisión Mantenimiento            Gerencia Producción Soplado      Mantenimiento Palmas       Palmas                                                      
2      Producción      10P30804      Soplado Palmas  Mantenimiento            Gerencia Producción Soplado      Mantenimiento Palmas      Palmas
Avatar of Sean Stuber
Sean Stuber

you probably have white space in the columns you can't see
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enrique_aeo

ASKER

i agree

1      11      Mantenimiento Palmas      20
2      11      Mantenimiento Palmas       21

As I can do an UPDATE to remove blanks?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial