[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] sql select fra to tabeller



On Sun, 14 May 2006 17:20:39 +0200, Hans Schou wrote:

> 
> Hmm, det ligner en designfejl hvis du har brug for det og ikke kan det.
> 
>> Så jeg kan have et "ORDER BY dato LIMIT 3" på den samlede tabel.
> 
> Jeg kan ikke se andet end at du skal kopiere til en temporær tabel SELECT
> dato INTO TEMP TABLE mytbl FROM tabel_a LIMIT 3; SELECT dato INTO TEMP
> TABLE mytbl FROM tabel_b LIMIT 3; SELECT * FROM mytbl LIMIT 3;
> 
> http://www.postgresql.org/docs/7.4/interactive/sql-selectinto.html
> 
"SELECT dato FROM tabel_a WHERE dato > date('now'); samlet med SELECT dato
 FROM tabel_b WHERE dato > date('now');"

Spørgsmålet er så blot, om der ønskes et cartesisk produkt eller en
naturlig join. Hvis blot der ønskes et cartesisk produkt, kan det klares
med en select:
select dato from tabel_a where dato > date('now') union select dato from
tabel_b where dato > date('now')

-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-06-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *