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.

Empfohlene Antworten

Veröffentlicht

hallo zusammen

Ich habe ein Problemm in einer Tabelle die Doppelte einträge hat.

In der Tabelle Existieren 2 foreignkeys und 1 primary key

wenn die beiden foreignkeys gleich sind und der primary unterschiendlich dann ist es ein doppelter eintrag. das problem ist jedoch das in dieser tabelle 250'000 einträge sind und wenn ich die tabelle mit sich selber verknüpfe dann rechnet er 62 Miliarden einträge aus und das bringt die ganze DB zum stillstand gibt es vieleicht eine möglichkeit das ganze auf eine schlankere art zu machen?

select * from (select products_id, products_attributes_id, products_options from fs_products_attributes) sel1 join (select products_id, products_attributes_id, products_options from fs_products_attributes) sel2 on sel1.products_id = sel2.products_id where sel1.products_options = sel2.products_options and sel1.products_attributes_id != sel2.products_attributes_id

products_id & products_options = foreignkey

products_attributes_id = primarykey

Freundliche grüsse

Neo336

Bearbeitet von neo336

  • 2 Wochen später...

select * from (select products_id, products_attributes_id, products_options from fs_products_attributes) sel1 join (select products_id, products_attributes_id, products_options from fs_products_attributes) sel2 on sel1.products_id = sel2.products_id where sel1.products_options = sel2.products_options and sel1.products_attributes_id != sel2.products_attributes_id

Nur interessehalber - ist das Statement unten gleichbedeutend mit dem Statement oben? Oben ist, meinem Verständnis nach, nicht korrekt gejoined, oder?!

select * from

(select products_id, products_attributes_id, products_options from fs_products_attributes) sel1

join

(select products_id, products_attributes_id, products_options from fs_products_attributes) sel2

on (sel1.products_id = sel2.products_id

and sel1.products_options = sel2.products_options)

where sel1.products_attributes_id != sel2.products_attributes_id

Viele Grüße

Daij

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.