![]() |
Re: Problem mit Query
SQL-Code:
SELECT a.voting_text, count(a.ID) AS ergebnis FROM
(select c.voting_text, MAX(b.voting_id) as ID from data b join data c on c.voting_id = b.voting_id group by b.voting_ip) a group by a.voting_text; |
Re: Problem mit Query
Jetzt funktioniert es schon "besser":
Ich bekomme jedoch für Antwort "Ja" bei ergebnis 2. Eigentlich sollte es 1 bei Ja und 1 bei Nein sein. |
Re: Problem mit Query
So sollte es funktionieren:
SQL-Code:
SELECT a.voting_text, count(a.voting_ip) AS ergebnis FROM
( select distinct( c.voting_ip), max(c.voting_text) as voting_text from data b join data c on c.voting_ip = b.voting_ip group by c.voting_ip) a group by a.voting_text; |
Re: Problem mit Query
Danke, hab es jetzt (mit Hilfe eines Freundes) so gelöst:
SQL-Code:
Danke an alle Mitdenker :)
SELECT t1.voting_text, count(*) AS `ergebnis`
FROM `data` t1 LEFT JOIN `data` t2 ON t1.voting_ip = t2.voting_ip AND t1.voting_date < t2.voting_date WHERE t2.voting_id IS NULL GROUP BY t1.voting_text; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21: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