Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Search two keyword togather!!

Posted on 1998-09-23
Medium Priority
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??  
Question by:ruisun
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

manish77 earned 100 total points
ID: 1090234

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

Author Comment

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!!!


Expert Comment

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%'


Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

730 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