473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Anti-Query

I'm writing a program that has an auto spelling correction feature. it is
kind of like google and ebay's spelling suggestion features (did you mean?:
correctly spelled word)
I need to write a sql query that does partial match, which is the exact
opposite as how you would do a wild card search.

Wildcard search example
---
Select id from table1 where message like 'i%like%food%'
--
it would yield results like these
"i like mexican food"
"i don't like this food"
"i like food in general"
>>>>>>>>>>>>>>>>>>>>

WHAT I NEED TO DO
I need to do the exact opposite of the example above
this is what i have in the database.
ID(autonumber) keywords(varchar)
---------------- --------------------
1 i%like%food%
2 i%like%sports%
3 i%like%computers%
and so on
What I would like to do is to input these sentences and get an output of the
wild card.
---pseudo code---
select id from table1 where keywords like 'i like food in general'
---
results:
'i%like%food%'
i hope this makes sense

Thanks in advance,

Aaron
Nov 22 '05 #1
2 1420
If I understand you correct... SELECT id From table1 WHERE Message
LIKE(MessageColumn, ' ' , '%')

However, I'm not sure what this would accomplish so I am probably not
understanding the goal. If your actual query was select id from table1
where keywords like 'i like food in general'

You want it returned with % instead of spaces?
"Aaron" <ku*****@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm writing a program that has an auto spelling correction feature. it is
kind of like google and ebay's spelling suggestion features (did you mean?: correctly spelled word)
I need to write a sql query that does partial match, which is the exact
opposite as how you would do a wild card search.

Wildcard search example
---
Select id from table1 where message like 'i%like%food%'
--
it would yield results like these
"i like mexican food"
"i don't like this food"
"i like food in general"
>>>>>>>>>>>>>>>>>>>>>
WHAT I NEED TO DO
I need to do the exact opposite of the example above
this is what i have in the database.
ID(autonumber) keywords(varchar)
---------------- --------------------
1 i%like%food%
2 i%like%sports%
3 i%like%computers%
and so on
What I would like to do is to input these sentences and get an output of

the wild card.
---pseudo code---
select id from table1 where keywords like 'i like food in general'
---
results:
'i%like%food%'
i hope this makes sense

Thanks in advance,

Aaron

Nov 22 '05 #2
No that was not the query, it was only a example, everything after the WHERE
clause is fake.

say the user type in 'i like food in general'. the search engine would look
for this string a the keyword column.

the keyword column has records like

'a%apple%'
'a%airpline%'
'i%like%food%'

it would return 'i%like%food%' as result.

Thanks
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OT**************@TK2MSFTNGP12.phx.gbl...
If I understand you correct... SELECT id From table1 WHERE Message
LIKE(MessageColumn, ' ' , '%')

However, I'm not sure what this would accomplish so I am probably not
understanding the goal. If your actual query was select id from table1
where keywords like 'i like food in general'

You want it returned with % instead of spaces?
"Aaron" <ku*****@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm writing a program that has an auto spelling correction feature. it is kind of like google and ebay's spelling suggestion features (did you

mean?:
correctly spelled word)
I need to write a sql query that does partial match, which is the exact
opposite as how you would do a wild card search.

Wildcard search example
---
Select id from table1 where message like 'i%like%food%'
--
it would yield results like these
"i like mexican food"
"i don't like this food"
"i like food in general"
>>>>>>>>>>>>>>>>>>>>>>>

WHAT I NEED TO DO
I need to do the exact opposite of the example above
this is what i have in the database.
ID(autonumber) keywords(varchar)
---------------- --------------------
1 i%like%food%
2 i%like%sports%
3 i%like%computers%
and so on
What I would like to do is to input these sentences and get an output of

the
wild card.
---pseudo code---
select id from table1 where keywords like 'i like food in general'
---
results:
'i%like%food%'
i hope this makes sense

Thanks in advance,

Aaron


Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: jcnews | last post by:
I am using Windows XP and am learning how to program in Java. Is there any way to get my fonts to be anti-aliased in both editors and in my programs? The non anti-aliased fonts don't look very...
0
by: Jason | last post by:
Hi guys, I am having problems with VML. I had been working on a problem for sometime now, and I just recently discovered what the problem really was: VML was anti-aliasing my rectangles, but I...
7
by: Maxim Shemanarev | last post by:
I'd like to announce my project called Anti-Grain Geometry. http://www.antigrain.com Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard...
17
by: rgoya | last post by:
Peace be with you! About a year ago, I created a JavaScript which turns any web site into an online anti-war protest: http://www.geocities.com/rgoya/javascript/PROTEST.HTM I have recently...
3
by: Michel | last post by:
Is there a way I can anti-aliasing a gif to be able to get a hi-quality resizeable backgroundpicture. When a GIF of JPG is being resized by the browser you get wurse pictures because it needs a...
6
by: bissatch | last post by:
Hi, I want to display text on screen with anti aliasing to make it appear smoother. Is it possible to do this in browsers by perhaps applying a style to it or is it entirely up the the browser?...
22
by: Martin Eyles | last post by:
Hi, I have some text on a page in a small font. The font size has been OK in other applications, but in a web browser, the legebility suffers due to the anti-aliasing. Is there a way to turn off...
4
by: Mike | last post by:
Hi, I took an interest a few months ago in an anti framebreaker javascript. All my research told me that it was impossible. If a website is loaded into a frame/iframe then if it has frame...
2
by: adam.timberlake | last post by:
I was following an article on a website earlier, and although it outputted the pie chart for me perfectly, I want to make it anti- aliased somehow. I have linked to the specific article below just...
6
by: Roderik | last post by:
Hi, On my website I implemented tooltip alike layers when you hover the category items in the sidebar on the right. See: http://www.roderik.net/ The layers that become visible have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.