MySQL Spalten updaten: Werte aufsteigend setzen.

Weil ichs gerade für ein TYPO3 Flow Projekt brauchte… 🙂 Notiz an mich:

How to update a MySQL column with ascending numbers

Given the problem you have a new column postion and that column should be updated for all existing rows with ascending numbers. Furthermore these numbers should be generated by a special order. In order to achieve that you could do the following:

SET @pos := 0; UPDATE pages SET position = ( SELECT @pos := @pos + 1 ) ORDER BY updated_at DESC;

Quelle: How to update a MySQL column with ascending numbers – makandropedia

TYPO3 Flow auf (L)Ubuntu installieren

TYPO3 Flow auf (L)Ubuntu installieren


Fatal error: Uncaught Error: Call to a member function id() on array in /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php:36 Stack trace: #0 /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(538): CrayonFormatter::format_code('', Array, Object(CrayonHighlighter)) #1 [internal function]: CrayonFormatter::delim_to_internal(Array) #2 /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(516): preg_replace_callback('#()#msi', 'CrayonFormatter...', 'sudo apt-get up...') #3 /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(166): CrayonFormatter::format_mixed_code('sudo apt-get up...', Object(CrayonLang), Object(CrayonHighlighter)) #4 /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(186): CrayonHighlighter->process() #5 /home/laufedb in /home/laufedbk/www.greth.me/wordpress/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 36