asp.net关于数据库like查询语句?
表:v_Products
ID Name ParentID ParentPath
9 sda 18 0,2
10 sadasd 23 0,2,18
11 dasdas 23 0,2,18
12 Product1 5 0,1
13 Product2 1 0
14 111 5 0,1
现在我要根据产品类ID,查询类似于产品类ID的所有产品,我用LIKE来实现。
例如:产品类ID为0 id=0
select * from v_Products where ParentPath like '0%'
但是这样读出来的数据只有ID为第13的产品
如果产品类ID为2 id=2
select * from v_Products where ParentPath like '2%'
这样就完全读不出数据了
请问我这样写哪里错了,谢谢指教,急啊!