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.

MySQL/ UPDATE/ NULL und meine Probleme

Empfohlene Antworten

Hallo Ihr,

ich habe da mal ein simples Problem, bekomme das aber nicht gefixed. Ich habe eine Tabelle mit mehreren Spalten. In einigen sind keine Werte drin, sie sind auch nicht leer aber mit NULL vorbelegt. Diese Felder moechte ich nun gerne mit einer 0 fuellen. Mein Ansatz:

UPDATE table SET spalte_x=0 WHERE spalte_x=NULL;
Ich steh irgendwie aufm Schlauch. Denn mein phpmyadmin sagt mir jetzt nur " Betroffene Datensätze: 0 (die Abfrage dauerte 0.0029 sek)". Huestel, sollten jetzt nicht alle Felder die mit NULL belegt waren mit einer 0 gefuellt sein ? Habe schon einige Variationen versucht aber nuescht klappt:

UPDATE table SET spalte_x=0 WHERE spalte_x=NULL;

UPDATE table SET spalte_x=0 WHERE spalte_x='NULL';

UPDATE table SET spalte_x=0 WHERE spalte_x<>1 AND spalte_x<>2;

UPDATE table SET spalte_x=0 WHERE spalte_x='';

Vielleicht kann mir ja jemand weiterhelen und mir das Brett vorm Kopf entfernen.

Gruessle und Dank

bio*

Hallo,

habe das Problem gefixed ... Doku lesen ist doch was feines also entschuldigt den Thread.

Loesung:

UPDATE table SET spalte_x=0 WHERE spalte_x IS NULL;

Also statt einem = (gleich) einfach ein IS (englisch fuer 'ist') und schon klappt das auch mit MySQL. So simpel !

Gruessle

bio*

Hi,

WHERE blah.blupp IS NULL

Gruß Jaraz

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.