Solved

Search two keyword togather!!

Posted on 1998-09-23
3
218 Views
Last Modified: 2010-03-19
I think I know how to search in a table "SELECT * from Name Where columname=Keyword"
      But now I want that I can search in a table not just by one keyword , but by two. or more
      T.ex. I want to search something match two keyword by writing: keyword1 + keyword2  in the search form  Like I do it in "Yahoo", I want to know how can I write script??  
0
Comment
Question by:ruisun
3 Comments
 

Accepted Solution

by:
manish77 earned 50 total points
ID: 1090234
IF i UNDERSTAND YOUR QUESTION CORRECTLY THIS MIGHT HELP...

SELECT * from Name Where columname LIKE KeyworD OR COLOUMNAME LIKE KEYWORD2
0
 

Author Comment

by:ruisun
ID: 1090235
Thanks for answer!!
But when I write in form field "keyword1 + keyword2", then in the action file how can I difference the keyword1 and keyword2, because now "keyword1 + keyword2" is a whole string!! I have to seperate them first, I think!! Then I can use "SELECT * from Name Where columname LIKE KeyworD1 OR COLOUMNAME LIKE KEYWORD2"

Thanks again!!!


0
 
LVL 1

Expert Comment

by:gertrude
ID: 1090236
If you don't need to search on substrings you might try something like:

  SELECT au_lname
    FROM authors
   WHERE au_lname in('Bennet', 'Dull')

If you do use the LIKE operator, be sure to include '%' on one or both ends of the string to be search for.  For example:

  SELECT au_lname
    FROM authors
   WHERE au_lname LIKE 'smi%'


0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question