I have a table named T_PERSON with rows such as FIRSTNAME varchar, LASTNAME varchar, CUSTOMERTYPE int, SELLERID int (and more)
Additionally I have a large "SQL IN statement" list of persons like this
:( 'JOHNxSMITHx12345x1337', 'SARAxBANNERx7612x1337' ... )
SELECT * FROM T_PERSON WHERE
STR_REPLACE(FIRSTNAME + 'x' + LASTNAME + 'x' + STR(CUSTOMERID) + 'x' + STR(SELLERID)) in
( 'JOHNxSMITHx12345x1337', 'SARAxBANNERx7612x1337' )
We ended up going for a very different solution, running one Query per row to be updated. Now I feel stupid and the guy at DB who did the QA of my Query who asked the question should be ashamed.
The column names FIRSTNAME LASTNAME etc. are of course all implicitly a part of the one and same TABLE ROW. So they can be written as THESAMEROW.FIRSTNAME, THESAMEROW.LASTNAME etc. Looking at it this way, only one string will of course be constructed per row in the database.
My worry that N^4 strings would be created is therefore completely wrong, and my Query would scale perfectly linear on a larger database.