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] Text case-sensitiv vergleichen

Empfohlene Antworten

Veröffentlicht

Hi!

Ich habe hier ein seltsames Phänomen: Es gibt eine Tabelle mit einem Feld vom Typ TEXT:


id | feld1

----------

1  | Text

Wenn ich jetzt die Tabelle auf das Vorhandensein eines Wertes befrage, der nicht in der Datenbank steht, bekomme ich ihn trozdem zurück, Beispiel:

SELECT id FROM tabelle WHERE feld1 = 'text'

Ergebnis: Ich bekomme 1 zurück, will ich aber nicht.

Wie kann man das ändern?

Gruß, Tobias


SELECT col_name FROM table_name WHERE col_name LIKE BINARY 'a%'.

oder noch viel cooler

SELECT col_name FROM table_name WHERE STRCMP(spalten_name, "A") = 0

Wenn Sie wollen, dass eine Spalte immer abhängig von der verwendeten Groß-/Kleinschreibung behandelt wird, deklarieren Sie sie als BINARY

google.gif

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.