Consider the following array:
"Bank of America" => "BOA",
"Microsoft" => "MSFT",
"Berkshire Hathaway" => "BRK"
In reality, the array is a 100 pairs long. If I have a MySQL table "strings" with text records:
str_id str_text
-------------------------------------------------------------
1 I wish I had bought Berkshire Hathaway in the 1980's!
2 Microsoft to release Windows 8 in 4 flavours
Is there a way to - in SQL! - loop through all millions of records and replace all company names with their tickers? So that when the query is done, the strings table would look like this?
str_id str_text
-------------------------------------------------------------
1 I wish I had bought BRK in the 1980's!
2 MSFT to release Windows 8 in 4 flavours
I'm asking since it is possible with PHP, but that would be inherently slower, since I'd have to retrieve a couple of thousand records, loop through them, update them, retrieve thousands more using crontab, etc.