![]() |
Datenbank: MySQL • Version: 5 • Zugriff über: ZEOS
Ergebnis einer Subquery als Ausgabe und Bedingung
Hallo,
ich habe in einer SQL-Abfrage eine Subquery mit SUM und vielen anderen Bedingungen. Jetzt möchte ich einmal das Ergebnis dieser Subquery als Ausgabe und einmal als Bedingung verwenden. Gibt es da eine Möglichkeit das zu tun ohne diese Subquery zweimal zu verwenden? also etwa so sieht es jetzt aus:
SQL-Code:
Danke schonmal
select t1.*,(select SUM(*) from tabelle2 where artikelid = t1.id)anzahl from tabelle1 as t1 where (select SUM(*) from tabelle2 where artikelid = t1.id)>"0"
:angel: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:34 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