Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-01-14 : 22:47:10
|
Chris writes "Query?
SITUATION: I have a 32 million recordset of case titles(<100 char long). They were orginally store without whitespaces. (Don't ask!) EXAMPLE "Billings Smith Detroit" = "BillingsSmithDetroit"
OBJECTIVE: Keyword Search, Must be Ordered by Priority (integer 1-100)
WHAT I HAVE DONE: I have started with a three Column RecordSet; Title , ReverseTitle & Priority ReverseTitle is populated with the title reversed. Title is Prime, ReverseTitle is Indexed, Priority is Indexed
QUERYS To retreive a single Recordset which has a string ("Test") at the start of the Title:
SELECT Title FROM Cases WHERE Title LIKE 'Test%' ORDER BY Priority
To retreive a single Recordset which has a a string ("Test") at the end of the Title:
SELECT TOP 10 Title FROM Cases WHERE ReverseTitle LIKE 'tesT%' ORDER BY Priority
THE QUESTION: To retreive a single Recordset which has a a string ("Test") at both the Beginning AND the end of the Title:
SELECT TOP 10 Title FROM Cases WHERE (Title LIKE 'Test%') OR (ReverseTitle LIKE 'tesT%') ORDER BY Priority
THIS BRING DOWN THE SYSTEM, EVEN WITH TOP 10. ORDER BY SEEMS TO BE THE PROBLEM.
ANY ANSWERS WOULD BE APPRECIATED (Of course finding WITHIN the Title is another question)
Thanks Guys Best of the New Year!" |
|
|
|
|
|