C
Chetana
Hi All,
I want the query in sql which gives count of records for 2 conditions.
Say i have table Category which has CategoryID and SubCatID as 2
columns.
Then suppose i want count for the records which has CategoryID=1 and
SubCatID =1 .
But I have SubCatID field as comma separated means it may has 1,2,3 or
1 or 11,2,3
I have used query like
select count(*) from Category where CategoryID=1 and SubCatID like
'%1%'
but it take 11 as subcatid which i donot want .
So is there any solution to this problem?
Thanks
I want the query in sql which gives count of records for 2 conditions.
Say i have table Category which has CategoryID and SubCatID as 2
columns.
Then suppose i want count for the records which has CategoryID=1 and
SubCatID =1 .
But I have SubCatID field as comma separated means it may has 1,2,3 or
1 or 11,2,3
I have used query like
select count(*) from Category where CategoryID=1 and SubCatID like
'%1%'
but it take 11 as subcatid which i donot want .
So is there any solution to this problem?
Thanks