没办法只有这些分数了,第一次到这个版求助:
现搜索一个表的数据,有时间,ip,深度值(搜索的数有点大,感觉要查看每行中的数据)---------------
 然后去判断另外一个表中是否存在该ip,该时段的的深度值,
如果有则update(时间,ip,深度值),如果没有则插入一条数据(时间,ip,深度值)

解决方案 »

  1.   

    老兄用个存储过程吧~~~
    create procedure spupinsert
    @id int,
    @deep decimal(7,2) ,
    @timer datetime
    as
    --判断表中是否有满足条件的行,如果有则执行更新操作~
    if exists(select * from 表 where ID=@id and DEEP=@deep and TIME=@timer)
    update ...
    else  --没有行可返回,则插入该值
    insert into 表 values ...
      

  2.   


    create procedure spupinsert
    as
    begin
    if(select count(表1.字段) from 表1 inner join 表2 on 表1.ip = 表2.ip and 表1.deep = 表2.deep and 表1.time = 表2.time)>0
    update .....
    else
    insert .....
    end