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AR3rMSGOFekUz8GSiWL8nHm/FfTHnmOyOhJfJDKIZADHVrMI9Carx4fV1SAE0dTuWAN63itiPvnMgBykAS3N73Yanivaz7GkN9sVa+DdpJd8M0RTl2INSP0+htEmne8F3KA3KbWwgCLxMq+Rdx40atnGMe56bGHCXNHHGhCxpbFiI2ZVOhKJZOI7Dx9rgGtLk8VGzMp1RF54LEhjFy1pxeljDZS2pYFiI2ZXdaRyzMcasM6WtmN2VUfGPg8fa8AyW9qO2VUdcZz/B9vyeEFYaMlZAAAAAElFTkSuQmCC" alt="" />

现在我们将Province列值和Company列值互换,代码如下:

UPDATE test2
SET Company=Province,
Province=Company

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR0AAACGCAIAAABv3skYAAATdklEQVR4nO1du24jtxrmiwTJE6gSjInfIEWKSG1UnJHhNoXgVGniLrIXsAE/gxrDq4sBP4MLA0Z8axY4uSc+1drOWrK1MvYUc+P9MhzOkDSJH4ZEUzP/7RPJET8SHB4dBwkSpFoBh0fHn0yWh4cHo9evvDin8Cc3dVYtDtn48PAQcIUX5xT+5KbOqsUhG+vA1f39vdHrV16cU/iTmzqrFodsvL+/D7jCi3MKf3JTZ9XikI0N4erd3vr63jt+TXOFGr93e+sgK5sn9SslKHQnA8inNnm4XGHYCCyMSx24uru7w6vsxhWpMJqiJ5s2hTApdCcDUKhtk4fLFUEilTDQmE/u7u6M4+r9+/d4ld24IhS2STlGYTl5bzP7CnDACEERJdLJpjVfd+/fvweHR8cfP64WT0sTslq9/HP7P/z612+i6M1V8iLvxZOapoWicK4tJoXyG5O02UY/AgCAaHe2k764gevTlk/LSb8YvfSn6S12+kXNpA9Af7bIGke7NyWdDLs6enNFvzVNbcTAL3eu7YsLFprC3sScjQkZoNyQ5PW0cBHs/MXTcvE06wO0Rtobiarg8Oh4+XE1XzybkNXq5a+//8Gvf7UbRbuXi5thBOLJ83zxPJ9sgGj30owOugqn2mItC+UvdyLQn86vdiMQDa+ekRfR7mX+Nm9JuuJ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I7Lxuz0/c46HTzrZWTGAq9mg3er0YN7QbNDu7t8edEjuiaKedB7+1e6XoD/Tod9bxcPnMx0l40edXwmHeTbiisI873baySDqYNAuM5pq0kbOxhUcWv5t+m2L5MNpchQqOszRwRXl3O7+RrrFRX/qzbndZ3q8Ruo8ilpPfqSZnCOcTGcc5SQLgA2bLRK5+RWDAkzZ5SL1CZYbuWfSbVEqx5VP+1tUhatcsHEgtSujvq075wgn8461ltnxojnR7K8wShXtWGH0MG8qS1JaTwYPf9LPufc+8PANzK/yt2dc8ARcGbexDK5QCCXj3nQQmFxnNmi3BqPKcTWfxqA/nj89zq+HEYgnbvPwTT8P5PRR1uGKwzz3A1fkPgLcDSpoHVdW3+vq4ork4X8Y91MsxxOfePiV/3515tY48JbNPPcEV+fFPgLtlnDjlwxOxMYniZc0cRV4+ML4UcHjyHMLH8QVG1FcBR6+dPywhxZntD6KVZrS2QNxxUYEV4GH71z8XNfZVxsRXAUevnPxc11nX23E1lsEHr5j8XNdZ19tRHAVSiihVFISdP0fkhV+Ucr8joIAAAAASUVORK5CYII=" alt="" />

这是第一种列值互换方式!

下面是第二种在部分数据库中有效的互换方式:

UPDATE test2
SET Company=Company+Province,
Province=Company-Province,
Company=Company-Province;

这里的加减号可能有些数据库不支持,根据不同的DBMS做相应的替换。

上一篇:前端模块化之seajs


下一篇:gcc 编译的四大过程