zoukankan      html  css  js  c++  java
  • sql语句---删除

    想清下数据库中的脏数据,A表存放属性,B表存放位置,但是上传的位置如果是从地图上取位置,但是地图没有做居中操作的话,位置坐标在原点取值,属于错误数据,查查发现delete只能对某张表中的数据进行删除,所以分两步:

    1、删除A表中的问题属性数据:

    delete from A where ID in (select ID  from B where  charindex('121',Lon) = 0 and charindex('31',Lat)=0  )

    //把varchar转成float查找某个经纬度范围内的数据

    delete from A where ID in (select ID  from B where Convert(float,Longitude) between 100 and 130

    and Convert(float, Latitude) between 20 and 40  )

    2、删除B表中的位置数据:

    delete   from B where charindex('121',Lon) = 0 and charindex('31',Lat)= 0

    delete   from B where Convert(float,Longitude) between 100 and 130

    and Convert(float, Latitude) between 20 and 40 

  • 相关阅读:
    getComputedStyle方法获取元素CSS值
    js获得当前元素的样式
    移动端 Retina屏border实现0.5px
    CFA
    LCD驱动
    EPD的驱动
    camera原理
    Perl实战(一)
    Perl的debug小技巧
    Bus memory attribute
  • 原文地址:https://www.cnblogs.com/nygfcn1234/p/3394845.html
Copyright © 2011-2022 走看看