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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Feb 27, 2011, 1:00 PM
Suthish NairPosted Feb 25, 2011, 1:52 PM
Jaganathan BantheswaranPosted Feb 25, 2011, 10:10 AM
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.
Amit ChoudharyPosted Feb 25, 2011, 10:10 AM
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.
Syed ShakeerPosted Feb 25, 2011, 10:09 AM
I will return matching records based on Like condition