MySQL Forums
Forum List  »  German

Re: Update.Mysql.nur.bestimmer.String
Posted by: Thomas Wiedmann
Date: June 07, 2011 11:30PM

Hallo Franz,

fast richtig. Wie immer werden Funktionen und Klammern von innen nach aussen aufgelöst. Zum Schluß erfolgt der UPDATE als Zuweisung von rechts nach links.

SET teststring = SUBSTRING(teststring,1,LOCATE('{',teststring)-1)
1. LOCATE('{',teststring) findet die Position von '{'
2. Die gefundene Position wird um -1 verringert
3. SUBSTRING schneidet ab der 1. Pos bis zur gefundenen Position (-1) aus
4. Der ausgeschnittene Stringteil wird der Spalte TESTSTRING zugewiesen


WHERE teststring LIKE '%{%'
Sucht alle Datensätze, die irgendwo ein "{" in der Spalte TESTSTRING haben.

Grüße
Thomas

--
Die SQL-Backstube
http://www.twiedmann.de/sqlbackstube/index

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Update.Mysql.nur.bestimmer.String
1458
June 07, 2011 11:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.