日期:2014-05-16 浏览次数:20969 次
-----------------------------
表mytbl
-----------------------------
id parentID sortName sortPath
1 0 root 1,
2 1 牙膏 1,2,
3 2 高露洁 1,2,3,
4 2 佳洁士 1,2,4,
-----------------------------------
取数据
access:select * from [mytbl] where instr(sortpath,',2,')>0
sqlserver:select * from [mytbl] where charindex(',2,',sortpath)>0
删除数据
Access:delete * from [mytbl] where instr(sortpath,',2,')>0
sqlserver:delete from [mytbl] where charindex(',2,',sortpath)>0