September 7, 2011 at 3:54 am
OK i did like this but now this shows me those records too which do not match...mean when their counter field is 0...
select TOP 5 COMPANY,CategoryName,comp_kws,locStr,
len(COMPANY) - len(replace(COMPANY, 'ltd', '')) as cntcmp ,
len(CategoryName) - len(replace(CategoryName, 'ltd', ''))
as cntcat,
len(comp_kws) - len(replace(comp_kws, 'ltd', ''))
as cntkey,
len(locStr) - len(replace(locStr, 'ltd', ''))
AS cntStr
from vwSearchResult
GROUP BY COMPANY,CategoryName,comp_kws,locStr
order by cntcmp DESC,cntcat DESC,cntkey DESC,cntStr DESC
In this case cntStr is Zero for all five records.I want to check if it is Zero then Do not show any thing.how it could be.....when i put where cntStr>0..it give me error
September 7, 2011 at 3:59 am
select ...
from vwSearchResult
where (len(COMPANY) - len(replace(COMPANY, 'ltd', '')) + len(CategoryName) - len(replace(CategoryName, 'ltd', '')) + len(comp_kws) - len(replace(comp_kws, 'ltd', '')) + len(locStr) - len(replace(locStr, 'ltd', ''))) > 0
GROUP BY ...
September 7, 2011 at 8:58 am
Very Good Job
Viewing 3 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy