Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Spalten mit gleichem Inhalt

Empfohlene Antworten

Ich hab da ein Problem:

Ich muß mit PHP(da hab ich noch sehr wenig Ahnung von) oder SQL(auch nicht sehr viel mehr) folgendes machen:

Ich hab folgende Tabelle

Primärschlüssel | Wert1 | Wert2

-------------------------------

1 | 12 | ?

2 | 2 | ?

3 | 13 | ?

4 | 12 | ?

5 | 23 | ?

6 | 9 | ?

7 | 12 | ?

8 | 13 | ?

Nun soll folgendes geschehen:

alle Datensätze, in denen in der Spalte Wert1 ein Wert mehr als 1 Mal vorkommt (die 12 kommt z.B. 3 Mal vor, die 13 2 Mal) sollen ausgegeben werden.

Will also folgendes erhalten:

1 | 12 | ?

4 | 12 | ?

7 | 12 | ?

und:

3 | 13 | ?

8 | 13 | ?

... nur wie?!

*Kopf auf Tisch hämmer...*

Wenn ich das richtig verstehe und mein Humble SQL dafür auf Anhieb reicht:

SELECT * FROM TABELLE WHERE COUNT(WERT1) > 1 ORDER BY PRIMAERSCHLUESSEL

Hope it helps,

Daniel

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">Zitat:</font><HR>Original erstellt von captainhook:

<STRONG>SELECT * FROM TABELLE WHERE COUNT(WERT1) > 1 ORDER BY PRIMAERSCHLUESSEL

</STRONG>

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">Zitat:</font><HR>Original erstellt von hades:

<STRONG>wie wärs mit diesem statement?</STRONG>

was macht denn dieses group by? ich kann mit den erklärungen aus dem buch nix anfangen ...

danke für eure hilfe, ich probier das gleich mal aus!!

Das tuts irgendwie nicht:

select

antennen.aa_node_id,

antennen.bts_ci

from

antennen

group by

antennen.bts_ci

having count(antennen.bts_ci) > 1;

Die Fehlermeldung:

ERROR at line 2:

ORA-00979: not a GROUP BY expression

Hääääh?! :(

hi poldi,

schön, dass man aus deiner fehlermeldung jetzt auch dein verwendetes dbms erfährt ;)

-oracle :D

oracle möchte hier eine aggregatfunktion haben. (gefunden in: online hilfe oracle client 8.0.5 für nt/win2k)

select feld1, [aggregatfkt(feld2)] from schemaname.tabelle group by feld1

hilft aber in deinem fall nicht weiter, nimm wolles lösung mit der temporären tabelle.

gruss

[ 29. Juni 2001: Beitrag editiert von: hades ]

habs hinbekommen:

select

max(bts_ci)

from

antennen

group by

bts_ci

having count(bts_ci) > 1;

so funktioniert es ... warum auch immer.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.