你应该知道
update的用法吧。_______________________________________________________________多多交流    共同进步
[email protected]
http://nizvoo.myrice.com
_______________________________________________________________

解决方案 »

  1.   

    我想说的是用一条语句来完成。
    select * from table where (update table set id=1 where pass=0)
    只是这个写法不对。
      

  2.   

    oracle 中肯定不行
    只能分开写
      

  3.   

    现在问题是,只能在SELECT语句里来实现。能实现吗?
      

  4.   

    where (update table set id=1 where pass=0)
    这算什么条件呀
      

  5.   

    其实用什么条件不重要,我主要是想把UPDATE语句能嵌到SELECT语句中。我记得有方法的,只是忘记在哪儿看到的,想找也找不到。是否有其他写法,而不需要用到表名?
      

  6.   

    你是不是要提取PASS=0的记录呀
      

  7.   

    Select语句是只读的,执行Update违反了这个规则,我认为行不通。
      

  8.   

    在select中update是行不通的,不过你的意思可能是仅修改显示出来的记录集?
    如果是:
    oracle:
    select decode(id,0,1,id),...,...
    from table 
    where id in (0,1);
    SQL-server:
    把decode 改成iif
    select iif(id=0,1,id),...,...
    from table 
    where id in (0,1);
      

  9.   

    在select中update是行不通的,不过你的意思可能是仅修改显示出来的记录集?
    如果是:
    oracle:
    select decode(id,0,1,id),...,...
    from table 
    where id in (0,1);
    SQL-server:
    把decode 改成iif
    select iif(id=0,1,id),...,...
    from table 
    where id in (0,1);