Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/05/2010, 08:52
sharlymart
 
Fecha de Ingreso: abril-2010
Ubicación: Mexico
Mensajes: 35
Antigüedad: 14 años, 8 meses
Puntos: 0
Pregunta ayuda con una cosulta !!!!!!

hola mi consulta funciona perfectamente cuando una variable o campo de la consulta la iguala a un valor numerico, pero ahora quiero que se iguale a una cadena que contiene varios valores numericos .
TblComInt.CveEntCom=4535
cadena="4535,4536,4537,4538,4539,4540";

hora quiero k se iguale a una varible definida como cadena anteriormente: TblComInt.CveEntCom=4535



Código MySQL:
Ver original
  1. select TblIntegrantes.clave, TblIntegrantes.ApsEntInt,TblIntegrantes.NomEntInt,  Portafolios.portEntregados, Portafolios.portCal  from (select TblComInt.CveEntCom,TblEntInt.CveEntInt as clave, ApsEntInt, NomEntInt from TblComInt, TblEntInt where TblComInt.CveEntCom=4535 and TblComInt.CveEntInt=TblEntInt.CveEntInt and TblComInt.CveEntPrf=3   order by ApsEntInt, NomEntInt) as TblIntegrantes LEFT JOIN (select TblEntPrt.CveEntInt as clave2, count(TblEntPrt.CveEntPrt) as portEntregados, count(TblCalPrt.CalEntPrt) as portCal, TblEntPrt.CveIntRev, TblEntAct.CveEntAct from TblEntAct, TblAsgAct, TblEntPrt left join TblCalPrt on TblEntPrt.CveEntPrt=TblCalPrt.CveEntPrt where TblEntPrt.CveEntCom=4535 and TblEntAct.CveEntAct=TblEntPrt.CveEntAct  and TblAsgAct.CveEntCom=4535 and TblEntAct.CveEntAct=TblAsgAct.CveEntAct and TblEntPrt.CveIntRev=0 group by clave2) as Portafolios on TblIntegrantes.clave=Portafolios.clave2 order by TblIntegrantes.CveEntCom;

select TblIntegrantes.clave, TblIntegrantes.ApsEntInt,TblIntegrantes.NomEntInt, Portafolios.portEntregados, Portafolios.portCal from (select TblComInt.CveEntCom,TblEntInt.CveEntInt as clave, ApsEntInt, NomEntInt from TblComInt, TblEntInt where TblComInt.CveEntCom=4535 and TblComInt.CveEntInt=TblEntInt.CveEntInt and TblComInt.CveEntPrf=3 order by ApsEntInt, NomEntInt) as TblIntegrantes LEFT JOIN (select TblEntPrt.CveEntInt as clave2, count(TblEntPrt.CveEntPrt) as portEntregados, count(TblCalPrt.CalEntPrt) as portCal, TblEntPrt.CveIntRev, TblEntAct.CveEntAct from TblEntAct, TblAsgAct, TblEntPrt left join TblCalPrt on TblEntPrt.CveEntPrt=TblCalPrt.CveEntPrt where TblEntPrt.CveEntCom=4535 and TblEntAct.CveEntAct=TblEntPrt.CveEntAct and TblAsgAct.CveEntCom=4535 and TblEntAct.CveEntAct=TblAsgAct.CveEntAct and TblEntPrt.CveIntRev=0 group by clave2) as Portafolios on TblIntegrantes.clave=Portafolios.clave2 order by TblIntegrantes.CveEntCom;