<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">tienta esso:</DIV>
  <DIV style="FONT: 10pt arial">&nbsp;</DIV>
  <DIV style="FONT: 10pt arial">SELECT * FROM `establecimientos` WHERE 
  `diaconcepto` LIKE concat_ws("","%",(SELECT `valor` FROM `structd` WHERE 
  `nomcat`= 'Centro Comercial' limit 1),"%")</DIV>
  <DIV style="FONT: 10pt arial">&nbsp;</DIV>
  <DIV style="FONT: 10pt arial">limit 1 esso somiente para garantir no erros na 
  query.</DIV>
  <DIV style="FONT: 10pt arial">&nbsp;</DIV>
  <DIV style="FONT: 10pt arial">&nbsp;</DIV>
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=cristian.mejia@gmail.com 
  href="mailto:cristian.mejia@gmail.com">Cristian Alberto Mejia Medina</A> 
</DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=usuarios@mysql-hispano.org 
  href="mailto:usuarios@mysql-hispano.org">usuarios@mysql-hispano.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, January 10, 2008 2:51 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [MySQL Hispano] Una 
  consulta</DIV>
  <DIV><BR></DIV>Tengo dos tablas 'establecimientos' con la columna 
  'diaconcepto' que contiene "ABCDE" y 'structd' que contiene nomcat='Centro 
  Comercial' y valor=C, Necesito un query que me obtenga todos los registros de 
  'establecimientos' donde aparezca el valor de 'valor' de 'structd' donde 
  'nomcat' = 'Centro Comercial'... no se si me explique bien... <BR><BR>esta 
  consulta me funciona en todos los registros donde 'diaconcepto' tiene = "C", 
  pero no aquellos donde hay "AC", o "CB",,,&nbsp; quise poner % al inicio y 
  final del segundo select pero no es valido,,,, <BR>Alguna 
  idea?????<BR><BR>SELECT * FROM `establecimientos` WHERE `diaconcepto` LIKE 
  (SELECT `valor` FROM `structd` WHERE `nomcat`= 'Centro Comercial')<BR 
  clear=all><BR>-- <BR>TPI. Cristian Alberto Mejia Medina <BR><BR>Have a nice 
  day :o) 
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Usuarios mailing 
  list<BR>Usuarios@mysql-hispano.org<BR>http://lists.mysql-hispano.org/mailman/listinfo/usuarios<BR></BLOCKQUOTE><BR>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>