Q:

Inverting text data in MySQL

I would like to invert the text of certain records depending on if ValueA is greater than ValueB. If ValueA is indeed greater than ValueB, then I want to invert the contents of the field Content.
The image below shows the example table and the modifications I wish to make to that table.

NOTE:

ValueA and ValueB are INTs
The field Content is a data type TEXT
The field Content can have in excess of 25,000 characters

Ive also considered exporting the entire database, and checking if ValueA is greater than ValueB, and if so, then when exporting that record, it would invert the text in the Content field...
EDIT:
I access MySQL through putty.

A:

The function you are looking for is REVERSE().  You would need to write an update query to conditionally update the Content column.
UPDATE 
    YourTable
SET 
    Content = REVERSE(Content)
WHERE 
    ValueA > ValueB;

