Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/04/2008, 12:04
Avatar de wrafaelp
wrafaelp
 
Fecha de Ingreso: marzo-2008
Ubicación: Cercado de lima
Mensajes: 26
Antigüedad: 16 años, 1 mes
Puntos: 0
Como hago paraq No se repita el registro

mysql> SELECT (usb.sica010cabeceradeventas.Cliente),
-> usb.sica010cabeceradeventas.codcliente,
-> case 1 when usb.sica011detalledeventas.CodigoConcepto=26 then
-> CONCAT_WS('-',usb.sica011detalledeventas.Concepto , sum(usb.sica011detalledeventas.Precio)) end as m,
-> case 1 when usb.sica011detalledeventas.CodigoConcepto=27 then
-> CONCAT_WS('-',usb.sica011detalledeventas.Concepto , sum(usb.sica011detall
edeventas.Precio)) end as c1,
->
-> case 1
-> when usb.sica011detalledeventas.CodigoConcepto=33 then
-> CONCAT_Ws('-',usb.sica011detalledeventas.Concepto , sum(usb.sica011detall
edeventas.Precio))end as c2,
->
-> case 1 when usb.sica011detalledeventas.CodigoConcepto=36 then
-> CONCAT_WS('-',usb.sica011detalledeventas.Concepto, sum( usb.sica011detall
edeventas.Precio))end as diciembre
-> FROM profesionalizacion.fichafalsa, usb.sica010cabeceradeventas, usb.sica
011detalledeventas
-> where (profesionalizacion.fichafalsa.p_codMatricula=usb. sica010cabecerade
ventas.codcliente)
-> and (usb.sica010cabeceradeventas.CodVentas=usb.sica011 detalledeventas.Cod
Ventas)
-> and(profesionalizacion.fichafalsa.g_sede = 'TRUJILLO')
-> AND (profesionalizacion.fichafalsa.g_grupo = '133')
-> GROUP BY usb.sica011detalledeventas.Concepto, usb.sica010cabeceradeventa
s.Cliente;
+--------------------------+------------+---------------------+------------------+-----------------+----------------------------+
| Cliente | codcliente | m | c1 | c2 | diciembre |
+--------------------------+------------+---------------------+------------------+-----------------+----------------------------+
| EXCEBIO CABERRA ISABEL | 20070160 | NULL | Cuota 1-120.0000 | NULL | NULL |
| EXCEBIO CABERRA ISABEL | 20070160 | NULL | NULL | Cuota 2-60.0000 | NULL |
| EXCEBIO CABERRA ISABEL | 20070160 | Matricula -120.0000 | NULL | NULL | NULL |
| EXCEBIO CABERRA ISABEL | 20070160 | NULL | NULL | NULL | Pension Diciembre-100.0000 |
+--------------------------+------------+---------------------+------------------+-----------------+----------------------------+

********
Como haria paraq eso sea en un solo registro...


**********