Reputation: 29
Dear Stackoverflowers,
I have a table with two columns: column "A" and column "B".
Each column contains random strings with a length between 1 and 10 characters.
How do I create an update query that will alphabetically sort the values in each ROW and, if necessary, switch (update) the columns so the string in column "A" alphabetically precedes the string in column "B".
For Example:
Starting Values:
Col_A Col_B
ABC DEF
GHI JKL
PQR MNO
Ending Values:
Col_A Col_B
ABC DEF alphabetically, ABC preceeds DEF, therefore, no change
GHI JKL alphabetically, GHI preceeds JKL, therefore, no change
MNO PQR *alphabetically, MNO preceeds PQR, therefore switch values*
Thank you!
Upvotes: 0
Views: 219