Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Mehere Tabellen und Join - Schreibschutz? (https://www.delphipraxis.net/103884-mehere-tabellen-und-join-schreibschutz.html)

DeddyH 23. Nov 2007 15:50

Re: Mehere Tabellen und Join - Schreibschutz?
 
Ersetz mal das 2. SELECT durch FROM ;)

Stern 23. Nov 2007 15:54

Re: Mehere Tabellen und Join - Schreibschutz?
 
oh, im Programm hab ich das mit FROM. Hier wohl schlecht kopiert... ;-)
Geht aber auch nich mit FROM....

Naja, trotzdem vielen Lieben Dank für eure Hilfen.--> Steffi ab zu SQL-TUTS... :)

Liebe Grüße
Steffi

Relicted 23. Nov 2007 15:56

Re: Mehere Tabellen und Join - Schreibschutz?
 
SQL-Code:
select K.KNR,
  K.KVORNAME,  
  K.KNACHNAME,
  K.KADRESSE,  
  K.KPLZ,
  K.KWOHNORT,
  R.RNUM,
  R.RBETRAG,
  R.RSTATUS,
  R.RDAT,

  from Kunden K
  inner join Rechnungen R on R.RKUNDE = K.Knr
nur nochmal zur auffrischung den allgemeinen sql aufbau (vereinfacht):

SQL-Code:
SELECT (spalte)
FROM (tabelle)
[ JOIN (tabelle) ON (bedingung) ....]
WHERE (bedingung)
[GROUP BY (spalte)]
oder nochmal die basics zum wiedereinsteigen :-) hier

gruß
reli

RavenIV 23. Nov 2007 16:03

Re: Mehere Tabellen und Join - Schreibschutz?
 
Solltest Dir vielleicht dann den Cross Join anschauen.
Zitat:

Cross join (Cartesian product)
Cross join, or the Cartesian product of two tables, can be defined as another (rather virtual) table that consists of all possible pairs of rows from the two source tables. Returning to our customer phone example in the nonequijoin section of this chapter, the cross join of the CUSTOMER and PHONE tables returns results very similar to what we've got on Figure 8-2 except it would also return the valid customer/phone combinations, excluded from the previously mentioned nonequijoin.

SQL99 standard syntax
This query will return all possible combinations of customer names and phone numbers by performing cross join of CUSTOMER and PHONE tables:

SELECT cust_name_s,
phone_phonenum_s
FROM customer CROSS JOIN
phone



Alle Zeitangaben in WEZ +1. Es ist jetzt 09:48 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz