table one:
ID      title        type
1        aa          1
2        bb          1
3        cc          1
4        dd          2table  two:
id                ids
1                1,2,3ids  就是table one 类型为1 的id ,   我现在要写个sql语句,
比如 我删除 table one 中的一条记录,  系统自动 统计table two 的 ids 个数!
同时修改 ids 字段的内容这sql 语句怎么写呢、  有点复杂!! 求救啊!!
写好了,加分!
谢谢了!!

解决方案 »

  1.   

    用程序分步骤去执行操作,一条SQL出不来的。
      

  2.   

    系统自动 统计table two 的 ids 个数!是按删除的id 统计?  统计的结果则呢么处理?这个用存储过程或者触发器写就行了
      

  3.   

    select wm_concat(id) from( select  1 id from dual union all select 3 from dual)
      

  4.   

    就是   当我删除 table one  一条记录时,  记录不是会少了一条吗那我的ids  就应该减少一个值、     我不想手动去减少、   我想 每删除一次后,就执行 统计  type 为 1 的  然后 赋给 ids