🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1686

Re: ORACLE - Select desde dos tablas _PERO_ no JOIN

#1686
From: Andres E. Hernando
Date: Fri, 23 Jun 2006 22:29
45 lines
1961 bytes
In 23 Jun 2006 13:44:02 -0700, Prometeo wrote: 
> Se?oras, se?ores y se?oritas....
> 
> Me he topado con esta curiosidad, y no s? si por evidente o por
> extra?a no he conseguido dar con como lograrla... cuando menos de un
> modo sencillo.
> 
> Resulta que tengo un par de tablas que tienen informaci?n similar,
> pero no ex?ctamente la misma. A saber:
> 
> - Tabla_Facturas
> - Tabla_Boletas
> 
> Resulta que quiero hacer un listado con ciertos campos (N?, proveedor,
> rut, etc.) que incluya a ambas... o sea, quiero mezclar ambos
> resultados.
> 
> El problema es que un simple
> 
> Select {atribs} From Tabla_Facturas, Tabla_Boletas

	SELECT DISTINCT {atribs}
	FROM   Tabla_Facturas, Tabla_Boletas;

	Con eso deberia bastar, segun san yo.

	Si las columnas en ambas tablas son del mismo
tipo puede que usar un union podria ser mas eficiente:

	SELECT {atribs} FROM Tabla_Facturas
	UNION
	SELECT {atribs} FROM Tabla_Boletas;

	Saludos,
	AHG.



-- 
"Duct tape is like the force. It has a light side, and a dark side, 
 and it holds the universe together..."
				-- Carl Zwanzig

http://www.diferenciados.blogspot.com/ 	 msn:a_hernand.com
BotBait: http://tinyurl.com/oz55e 		 [51]
Technical Details
Message-ID: <4g38ajF1kpc67U2@individual.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <1151095442.320683.70330@b68g2000cwa.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,de70835e7b6eaa7a
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "Andres E. Hernando" <NOherSPnandoAM@fas.harvard.edu>
Newsgroups: chile.comp.programacion
Subject: Re: ORACLE - Select desde dos tablas _PERO_ no JOIN
Date: 23 Jun 2006 22:29:39 GMT
Lines: 45
Message-ID: <4g38ajF1kpc67U2@individual.net>
References: <1151095442.320683.70330@b68g2000cwa.googlegroups.com>
X-Trace: individual.net gcyM488QQAdmyDSiFxPCjghKL9Cw88V26qiZNJ3a0fcSoUSW0C
X-Orig-Path: not-for-mail
User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (CYGWIN_NT-5.1/1.5.19(0.150/4/2) (i686))