[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: sql select fra to tabeller



On Sun, 14 May 2006 19:03:32 +0200, Michael wrote:

> 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')

Giver det ikke foreningsmængden af tabel_a og tabel_bs rækker?

Det er vel ikke det samme som det kartesiske produkt (alle par af
rækker fra tabel_a og tabel_b)?

Eksempel:

  tabel_a          tabel_b
  -------          --------
  Abba             Nirvana
  Genesis          Mudhoney

Foreningsmængden af tabel_a og tabel_b:

  Abba
  Genesis
  Nirvana
  Mudhoney

Kartesisk produkt af tabel_a og tabel_b:

  Abba,    Nirvana
  Abba,    Mudhoney
  Genesis, Nirvana
  Genesis, Mudhoney

Right?


  Mvh.

-- 
 "Its unique design sends a blinding spray of snow on         Adam Sjøgren
  it's passengers at the slightest bump."                sslug@sslug


 
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] *