How would I go about removing a string from a field in a sql query (using sql server 2005) and adding it to the front of the string?
For instance my search string field contains: 22378MA
I want to search for the following characters 'MA' in this case.
I would like the query to add this string to the front so that it returns a query like this:
MA2237
My field name is sku for the query.
Not sure I explained myself properly. I don't want to change the field only what is returned in the query in a view. In addition the field value changes so I can't hardcode the sku. In addition the sku length field length is variable. The suffix 'MA' may be changed for certain queries so I need to be able to use it in a case statement.
MA2237should be searched at the end of the column value? What says that it should beMAand notMA2orM? What is the defining rule?