Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Table as follows (Table Name FAQ)

Category Questions Answers

Admin do you have rights to book course? Yes

Admin at what time class starts? 2PM

Software All course photo is necessary? Yes


Design page as follows
Two Radio Button as follows

By Word (RadioButton1) By Category (RadioButton2)

Then i have one textbox(Textbox1)

Then i have one Search Button


First i select the By Word(RadioButton1) Then in the textbox i type course(from the table(FAQ)) then i click the Search Button in gridview display as follows

From the table (FAQ) want to check the word course is there?

In gridview as follows

Category Questions Answers

Admin do you have rights to book course? Yes

Software All course photo is necessary? Yes



Becuase in the table(FAQ) course word is there.


for that how can write the sql like query

matching the word course from the table FAQ.

how can i write the sql like query for my requirement.

Regards,
Narasiman P.
Posted

Like is pretty simple: it'a pretty much the same as "=" but with wild cards.
In your case, the most useful wildcard is probably "%" which matches zero or more of any character, much as "*" does in windows filenames.

So if you have a table contains Titles:
The Cat sat on the mat
The Cat who looked at a king
Cats a furry
The ArtistoCat
All about Dogs

Then:
SELECT Title FROM MyTable WHERE Title LIKE '%Cat%'
would return the top four titles, but not the final one.
 
Share this answer
 
select QuestionColumn from FAQ where NameofColumnWhere"course"WordIsPresent like '%course%'
 
Share this answer
 
v3
Comments
Ankur\m/ 14-Oct-13 7:52am    
What extra have you added to the answer which is not present in the above answers?
Check this out.
 
Share this answer
 
Comments
Ankur\m/ 14-Oct-13 7:49am    
Adding a description to the link helps. :)
Hi Narasiman P,

Please check this.
SQL
select Category, Questions, Answers from faq where Questions like '%course%'
 
Share this answer
 
Comments
Ankur\m/ 14-Oct-13 7:50am    
Care explaining what does it do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900