select count(*) from query where queryname like '%" + query + "%'"
please explain what is the use of this code?
'%" + query + "%'" so this query is the particular word to searched for matching
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Syed ShakeerRank #777 · 3K reputationPosted Feb 25, 2011, 5:09 AM EST
I will return matching records based on Like condition
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 25, 2011, 5:10 AM EST
The run time output of this query from the c# code will be like this. query variable's value will be like below:
select count(*) from query where queryname like '%Query1%';
it works as a contains function cause you have applied % on the both side of the query variable.
Hope you got the idea.
Thanks.
Please mark "Do you like this answer" if it helps you.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Feb 25, 2011, 5:10 AM EST
Consider the query = XXX;
the above query will return the total num of records which having the word 'XXX'.
The COUNT(*) function returns the number of records in a table.
Suthish NairRank #92 · 22.8K reputationPosted Feb 25, 2011, 8:52 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 27, 2011, 8:00 AM EST