![]() |
Datenbank: MYSQL • Version: 4 • Zugriff über: ODBC; DBE
SQL Abfrage (keine DS Doppelt) ?
Hallo. Gibt es so eine abfrage?
Nr: 1 2 1 2 3 4 5 6 7 Wieviel unterschiedliche nummer existierten in diese Tabelle? MFG |
Re: SQL Abfrage (keine DS Doppelt) ?
SQL-Code:
Liefert dir schon mal die Liste der unterschiedlichen Nr.... Das ganze in eine View vwNr gepackt:
select distinct Nr from Tabelle
SQL-Code:
select count(Nr) as Anzahl from vwNr
|
Re: SQL Abfrage (keine DS Doppelt) ?
Moin,
Zitat:
SQL-Code:
MfG
SELECT COUNT(*) AS anzahl
FROM Tabelle GROUP BY nr Thorsten |
Re: SQL Abfrage (keine DS Doppelt) ?
Folgende Anweisung bringt das richtige Ergebnis:
SQL-Code:
Select count(distinct id) from vwNr
|
Re: SQL Abfrage (keine DS Doppelt) ?
@dfried: Danke für den Hinweis.
Mein Beitrag war ja wohl völlig daneben. Sorry. Zitat:
SQL-Code:
MfG
SELECT COUNT(DISTINCT id) FROM Tabelle
Thorsten |
Re: SQL Abfrage (keine DS Doppelt) ?
Zitat:
|
Re: SQL Abfrage (keine DS Doppelt) ?
Zitat:
dfried's Lösung hingegen scheint zu klappen. Soweit hatte ich nicht gedacht. Das erspart damit also das Erstellen der View. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:23 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