Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/10/2006, 11:34
Avatar de PequeñoMauro
PequeñoMauro
 
Fecha de Ingreso: abril-2006
Ubicación: Lima - Perú
Mensajes: 600
Antigüedad: 18 años, 1 mes
Puntos: 3
Hola, no me habia fijado de la primera condición, lo primero que se me ocurre es hacer un UNION:
Código:
select distinct valor from Tabla
where CLAVE like '%Seccion1' and R='5' and C='2'
  and plantilla='Plantilla a'
UNION  
select distinct valor from Tabla
where CLAVE like '%Seccion1' and R='2' and C='4' and plantilla='Plantilla a' and 
	  substring(valor,7,4)='2006'
Para lo del año, lo hago con substring, espero que te ayude....
Saludos
__________________
"Nada en mis manos traigo tan solo a tu cruz me aferro....."