交换数据表两个字段值 | SQL

UPDATE temp_ent_lyew t1,temp_ent_lyew t2 SET t1.latitude=t1.longitude,t2.longitude=t2.latitude
where t1.latitude is not null and t1.longitude is not null and t2.latitude is not null and t2.longitude is not null 
and t1.latitude !='' and t1.longitude !='' and t2.latitude !='' and t2.longitude !=''
and t1.longitude<100 and t2.latitude>100;

作者:何钊

来源:博客园

链接:http://www.cnblogs.com/hezhao/

CSDN:http://blog.csdn.net/sinat_27403673

简书:http://www.jianshu.com/u/5ae45d288275

Email:hezhao_java@163.com

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

原文地址:https://www.cnblogs.com/hezhao/p/7392097.html