473,513 Members | 7,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL - Keyword searching / partial match

2 New Member
Firstly i would like to know the difference between Keyword searching using SQL and partial matching of a search.

I have to search for a book by key word in the book title. But allow TWO key words in the Query.

This is what i have:

Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Books
  3. WHERE Title LIKE '*Nature*' OR Title LIKE '*Britain*';
This is searching for the book "The Nature of Britain.

However i feel this is wrong somehow and i should b doing it another way. Please Help.
Thanks
Jan 10 '08 #1
3 3068
MikeTheBike
639 Recognized Expert Contributor
Firstly i would like to know the difference between Keyword searching using SQL and partial matching of a search.

I have to search for a book by key word in the book title. But allow TWO key words in the Query.

This is what i have:

Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Books
  3. WHERE Title LIKE '*Nature*' OR Title LIKE '*Britain*';
This is searching for the book "The Nature of Britain.

However i feel this is wrong somehow and i should b doing it another way. Please Help.
Thanks
Hi
If you want to return all recorords with both nature AND britain (in that order) in the tiltle then pehaps this:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Books
  3. WHERE Title LIKE '*Nature*Britain*';
If you want to return all recorords with both nature AND britain (but in any order) in the tiltle then pehaps this:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM Books
  3. WHERE Title Like '*Nature*' AND Title Like '*Britain*';
Your origional query returns all books with nature OR britain in the title.

MTB
Jan 10 '08 #2
danielleissy
2 New Member
Thanks that helps, But is this called a 'Keyword' search, because i have another problem which is very similar.

I have to search for a book by its author.
But it states that i should allow partial matching of the Authors names.

All i have done for this is the same as above.
But there must be a difference between partial matching a search and a keyword search.

Many Thanks.
Jan 10 '08 #3
MikeTheBike
639 Recognized Expert Contributor
Thanks that helps, But is this called a 'Keyword' search, because i have another problem which is very similar.

I have to search for a book by its author.
But it states that i should allow partial matching of the Authors names.

All i have done for this is the same as above.
But there must be a difference between partial matching a search and a keyword search.

Many Thanks.
I think to Like operator with the asterisk does precisely what you want. Try serching in Help for 'Like Operator' for a full explanation of its capabilities.

MTB
Jan 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1350
by: borges2003xx | last post by:
hi everyone. a problem: two binary strings, a="0101" b="000011110100"; i search a function f(a,b) that gives 1 if a is "contained" in b with any sub strings interposed. in this example a in...
2
7904
by: Christian Staffe | last post by:
Hi, I would like to check for a partial match between an input string and a regular expression using the Regex class in .NET. By partial match, I mean that the input string could not yet be...
2
7616
by: Andrew Chalk | last post by:
I have a customer who wants to SELECT records based on a partial match in a text field. For example, in a list of telephone numbers they want to search for all records that contain the digits '777'...
6
5665
by: PieOPah | last post by:
I am trying to write a query that will allow a partial word search. I know that if I have something along the lines of SELECT TblName.Name, TblName.Category, TblName.Type, TblName.Ingredients,...
7
2605
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search...
1
2932
by: chungiemo | last post by:
Hi thought I would do another thread as this one is a bit different from the previous problem I am looking for a solution to the relating problem Comparing 2 access databases with 2 tables,...
5
3358
by: kanley | last post by:
I have a main table with a text description field. In this field, its populated with a string of data. I need to identify from this string of data the name of the vendor using some keywords. I...
6
1449
by: satyanarayan sahoo | last post by:
What’s the role of Partial keyword which is bydefault written for a class in 2.0 ? public partial class Form1 : Form
1
2766
by: alamodgal | last post by:
hiiiiiii I have a problem in highlighting searching keyword.Actually im using this function for searching Public Function HighLight(ByVal Keyword As String, ByVal ContentFor As String) Dim...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.