AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi ADO / DBGrid / Query / mehrere Tabellen
Thema durchsuchen
Ansicht
Themen-Optionen

ADO / DBGrid / Query / mehrere Tabellen

Ein Thema von tschinkes · begonnen am 6. Jul 2008 · letzter Beitrag vom 8. Jul 2008
 
Benutzerbild von tschinkes
tschinkes

Registriert seit: 29. Jun 2004
Ort: Mannheim
29 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: ADO / DBGrid / Query / mehrere Tabellen

  Alt 6. Jul 2008, 20:54
Also wenn ich die Anweisung alleine nach Omata mache

Zitat von omata:
SQL-Code:
SELECT *, IIf(y.id IS NULL;'Nein';'Ja') AS entliehen
FROM mastertabelle x
LEFT JOIN (SELECT DISTINCT id
           FROM tabelle6) y
  ON x.id = y.id
Bei mir:

SQL-Code:
SELECT *, iif(y.Platte IS NULL,'Nein','Ja') AS Ausleihe
FROM Platte x
LEFT JOIN (SELECT DISTINCT Platte x
FROM Leihe) y
ON x.id = y.Platte
funkioniert es schon mal, aber da ich nun noch die anderen Tabellen habe und diese ebenfals in einen Join legen muss, dachte ich mir logischer weise, das ich den dann in den ersten From ersetze und es sieht wie folgt aus:

SQL-Code:
SELECT *, iif(y.Platte IS NULL,'Nein','Ja') AS Ausleihe
FROM (SELECT * FROM (((Platte t1
INNER JOIN Interpret t2 ON t2.id=t1.Interpret)
INNER JOIN Label t3 ON t3.id=t1.Label)
INNER JOIN Stil t4 ON t4.id=t1.Stil)
INNER JOIN Qualität t5 ON t5.id=t1.Qualität)
LEFT JOIN (SELECT DISTINCT Platte x
FROM Leihe) y
ON x.id = y.Platte
Nun gibt mir aber Delphi einen JOIN Syntax Fehler, mmhh ich merk schon da muss man ganz schön fix sein das ganze ohne Probleme hinzubekommen Oo
Tobi
"Let´s fetz", sagte der Spatz und sprang in den Mixer

Delphi 7 Enterprise inkl. JEDI / WinXP / Lahme Kiste als PC
http://www.kraft-internet.de
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:16 Uhr.
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-2025 by Thomas Breitkreuz