Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Search with +

Posted on 1998-09-23
4
Medium Priority
?
240 Views
Last Modified: 2010-03-19
If I want to use "+" in search function (t.ex USA + Job), how can I do??
0
Comment
Question by:ruisun
4 Comments
 
LVL 7

Expert Comment

by:Victor Spiridonov
ID: 1090230
Could you explain more details
0
 

Author Comment

by:ruisun
ID: 1090231
Thank U for U answer the question!!
It is like this: 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
 

Expert Comment

by:manish77
ID: 1090232
ARE YOU LOOKING FOR PARTIAL SEARCH ON BOTH KEYWORDS??
0
 
LVL 2

Accepted Solution

by:
formula earned 100 total points
ID: 1090233
Using your one keyword example, here are some other options:

 Your example: SELECT * from Name Where columname=Keyword
1) select * from Name where columnname="Keyword1" or
   columnname="keyword2" (returns records where columnname is
                          keyword1 or keyword2)
2) select * from Name where columnname in ("keyword1","keyword2")
   (Same as 1)
3) select * from Name where columnname like "%keyword1%" or
   columnname like "%keyword2%" (Columnname contains keyword1 or
                                 keyword2, but not both)
4) select * from Name where columnname like "%keyword1%" or
   columnname like "%keyword2%" (Columnname contains keyword1
                                  and keyword2)
5) select * from Name where columnname like "%keyword1%keyword2%"
   (Contains keyword1 and keyword2 in that order)
6) select * from Name where columnname like "%keyword2%keyword1%"
   (Contains keyword2 and keyword1 in that order)

It hope this gives you the choices you need. If not send more
specific info on your problem.


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

927 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