日期:2014-05-17  浏览次数:20722 次

SQL语句告诉快来啊 !12580求救!!!
table one:
ID title type
1 aa 1
2 bb 1
3 cc 1
4 dd 2

table two:
id ids
1 1,2,3

ids 就是table one 类型为1 的id , 我现在要写个sql语句,
比如 我删除 table one 中的一条记录, 系统自动 统计table two 的 ids 个数!
同时修改 ids 字段的内容

这sql 语句怎么写呢、 有点复杂!! 求救啊!!
写好了,加分!


谢谢了!!

------解决方案--------------------
lz 可以用触发器来实现
------解决方案--------------------
用程序分步骤去执行操作,一条SQL出不来的。

------解决方案--------------------
系统自动 统计table two 的 ids 个数!

是按删除的id 统计? 统计的结果则呢么处理?

这个用存储过程或者触发器写就行了
------解决方案--------------------
select wm_concat(id) from( select 1 id from dual union all select 3 from dual)
------解决方案--------------------
探讨

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

------解决方案--------------------
分开写两条,分布执行,然后加入事务。