πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #7817

Re: oftopic, creo

#7817
From: I[x_x]I
Date: Sun, 26 Jan 2003 17:12
21 lines
1639 bytes
On Sun, 26 Jan 2003 17:49:17 +0100, [ZoRo] wrote:

> a ver si me podeis ayudar.
> estoy haciendo un programita en perl para una base de datos que tiene dos
> tablas y no se como seria la sql.
> buien resulta que son tres tablas y queiro hacer una sql que haga:
> devolver el numero de resultados cuando el id de la talbla 1 sea igual al id
> de la tabla 2 y a su vez el la localidad de la trabla dos sea igual al de la
> tabla 3
> 
> me podeis ayudar?
> gracias

Creo que lo que quieres hacer se harοΏ½a asi:

select count(*) 
	from tabla1,tabla2,tabla3
		where tabla1.id = tabla2.id 
		and tabla2.localidad = tabla3.localidad;

Espero que te haya servido.
Technical Details
Message-ID: <pan.2003.01.26.17.13.04.988071@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!130.206.1.51.MISMATCH!heraldo.rediris.es!news.rediris.es!newsf01.ono.com!news.ono.com.POSTED!not-for-mail
References: <b113id$u78ct$1@ID-59646.news.dfncis.de>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,fe99e95a50417d12
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-01-26 09:13:00 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!130.206.1.51.MISMATCH!heraldo.rediris.es!news.rediris.es!newsf01.ono.com!news.ono.com.POSTED!not-for-mail
From: "I[x_x]I" <x_ximo@hotmail.com>
Subject: Re: oftopic, creo
User-Agent: Pan/0.13.0 (The whole remains beautiful (Debian GNU/Linux))
Message-ID: <pan.2003.01.26.17.13.04.988071@hotmail.com>
Newsgroups: es.comp.os.linux.programacion
References: <b113id$u78ct$1@ID-59646.news.dfncis.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Lines: 21
Date: Sun, 26 Jan 2003 17:12:53 GMT
NNTP-Posting-Host: 81.202.201.138
X-Complaints-To: abuse@ono.com
X-Trace: news.ono.com 1043601173 81.202.201.138 (Sun, 26 Jan 2003 18:12:53 MET)
NNTP-Posting-Date: Sun, 26 Jan 2003 18:12:53 MET