|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How can i use these values in my SQL?
Hello,
I am working on an ASP.NET web site. I have created a string keywords() with the keywords passed in the URL. I have something like this: SELECT * FROM mytable WHERE title LIKE '%asp%' OR title LIKE '%book%' OR description LIKE '%asp%' OR description LIKE '%book%' 1. I need to use the string values instead of asp, book, ... How can I do that? 2. The string can include 1, 2, 3 or more keywords. How would I use them in my SQL code? Thank You, Miguel |
|
#2
|
||||
|
||||
|
Quote:
Quote:
Code:
SELECT * FROM mytable
WHERE title LIKE '%keyword1%'
OR description LIKE '%keyword1%'
OR title LIKE '%keyword2%'
OR description LIKE '%keyword2%'
OR title LIKE '%keyword3%'
OR description LIKE '%keyword3%'
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > How can i use these values in my SQL? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|