September 14, 2006 at 11:33 pm
Hello friends .
please solve my problem, i am using sql server 7 ,in that
i have a table called Metadata
columns are slno,title,creator,subject,entrydate ...
slno is primary key.
entrydate contains date and time .
table contains more than 80,000 records.
i want to retrieve most recent records (say within 90 days or 120 days).and
i want to search some strings say 'english' in results of aboue query using
contains ( like contains(*,'english') ) or freetext only.
please help ....how to write queryyyyyyy
September 15, 2006 at 2:22 pm
Maybe I don't fully understand your requirement, but start with something like:
Select title, creator, subject, entrydate from metadeta
where entrydate>GetDate()-90 and subject like '%english%'
Note the % used for wildcard symbol, not *
Hope this helps
Elliott
September 15, 2006 at 10:44 pm
Thank you for Your reply.
Your query is similar to our requirements But here you are searching only in
subject column,but i have to search in all columns using contains or using
Freetext.
But if i use following query ,it is giving 0 results.
Select entrydate,creator from metadata where entrydate>GetDate()-90 and contains(*,'%english%')
but if i use yours query
Select title, creator, subject, entrydate from metadeta where entrydate>GetDate()-90 and subject like '%english%'
it wil give 200 records.
September 18, 2006 at 10:47 am
Pradeep,
Your query should work if the referenced columns are indexed for full-text. By way of refinement, you may want to specifically list the columns of interest ('ColumnA', 'ColumnF', ColumnT', etc.) rather than using the *. This would be more efficient and also you wouldn't have to set the non-relevant columns to fulltext searching.
Elliott
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply