Article View: chile.comp.programacion
Article #1481Re: problema join con mysql
From: Mauricio Gomez
Date: Sat, 05 Aug 2006 19:38
Date: Sat, 05 Aug 2006 19:38
43 lines
2134 bytes
2134 bytes
Rick_oj escribi�:
>
> pero si elijo c.rut o p.rut continua entregando errores, lo que finalmente
> hice fue select * al final...
Me piqu� :p
mysql> select * from clientes;
+-----+------------+-----------+----------+-----------+
| rut | ap_paterno | ap_matern | nombres | compra |
+-----+------------+-----------+----------+-----------+
| 111 | ap1 | am1 | nombres1 | |
| 222 | ap2 | am2 | nombres2 | efectuada |
+-----+------------+-----------+----------+-----------+
2 rows in set (0.00 sec)
mysql> select * from productos;
+-----+-------+
| rut | items |
+-----+-------+
| 111 | A |
| 222 | B |
+-----+-------+
2 rows in set (0.00 sec)
mysql> SELECT `ap_paterno`,`ap_matern`,c.`rut`,`items`
-> FROM clientes c join productos p
-> WHERE c.rut=p.rut and c.compra='efectuada';
+------------+-----------+-----+-------+
| ap_paterno | ap_matern | rut | items |
+------------+-----------+-----+-------+
| ap2 | am2 | 222 | B |
+------------+-----------+-----+-------+
1 row in set (0.00 sec)
mysql>
rro
Technical Details
Message-ID:
<eb2s35$r31$1@news.nivel5.cl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mailReferences:
<eb0aea$1bh$1@news.nivel5.cl> <Xns9816122D877E0jmsnews@200.27.221.71> <eb2nbs$plj$1@news.nivel5.cl>Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,599d380b0a5f3acc X-Google-Attributes: gid1593cb,public X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mail From: Mauricio Gomez <pregunte@sileinteresa.com> Newsgroups: chile.comp.programacion Subject: Re: problema join con mysql Date: Sat, 05 Aug 2006 15:38:12 -0400 Organization: Varios Lines: 43 Message-ID: <eb2s35$r31$1@news.nivel5.cl> References: <eb0aea$1bh$1@news.nivel5.cl> <Xns9816122D877E0jmsnews@200.27.221.71> <eb2nbs$plj$1@news.nivel5.cl> NNTP-Posting-Host: pc-23-73-104-200.cm.vtr.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.nivel5.cl 1154806693 27745 200.104.73.23 (5 Aug 2006 19:38:13 GMT) X-Complaints-To: news@news.nivel5.cl NNTP-Posting-Date: Sat, 5 Aug 2006 19:38:13 +0000 (UTC) User-Agent: Thunderbird 1.5.0.5 (X11/20060728) In-Reply-To: <eb2nbs$plj$1@news.nivel5.cl>