Ask a Question related to ASP Database, Design and Development.
-
Tallman #1
Need help with improving my databasequery.
I have the following MS Access table:
Name -- Content
Attributes -- Title
Shortdesc
Longdesc
Synoniemen
Using the next query I retrieve records from the table.
SELECT Content.Title, Content.ShortDesc, Content.Longdesc,
Content.synoniemen FROM Content WHERE ((Content.synoniemen LIKE
'%Blah%') OR (Content.Title LIKE '%Blah%') OR (Content.ShortDesc LIKE
'%Blah%') OR (Content.longdesc LIKE '%Blah%')) ORDER BY Title;
This query gives me all the records I need but I like to present them
in a specific order.
If the searchword is found in the TITLE field it is more important
then when it is found in the SYNONIEMEN field. The SYNONIEMEN field is
more important than the SHORTDESC field etc.
Is there a way to present the results in the desired order
(Title-Synoniemen-Shortdesc-Longdesc) ?
Thanx in advance.
Tallman
Tallman Guest
-
Improving frame rate
Hi. I have a scene with 20 animated and textured models, at about 1000 polygons each, and I?m getting REAL slow frame rates. Most of the time it... -
Need help improving authorization
I don't have a response in framework.aspnet, may be this one is a more appropriate group. = = = = = = = = = = = = = = = = == = = = = = == = = =... -
improving page tool
it would be great if it is possible to drag and drop pages between open FH documents with page tool, great for building layouts. also a´book´... -
Improving embedded browser
Dear sirs, I want to embed a browser inside my Director's movie. I have succeeded in embedding IE Active X control, but although it prefectly... -
? improving on a Sony707
I am reposting this as it seems to have got a bit lost. I am at present using aSony F707 and getting some good pics but a one off chance to... -
Aaron Bertrand - MVP #2
Re: Need help with improving my databasequery.
Could you do a UNION?
SELECT Title, ShortDesc, LongDesc, Synoniemen, [rank] = 1
FROM Content
WHERE Title LIKE '%BLAH%'
UNION
SELECT Title, ShortDesc, LongDesc, Synoniemen, [rank] = 2
FROM Content
WHERE Synoniemen LIKE '%BLAH%'
UNION
SELECT Title, ShortDesc, LongDesc, Synoniemen, [rank] = 3
FROM Content
WHERE ShortDesc LIKE '%BLAH%'
UNION
SELECT Title, ShortDesc, LongDesc, Synoniemen, [rank] = 4
FROM Content
WHERE LongDesc LIKE '%BLAH%'
ORDER BY rank, title
In SQL Server, you could use a CASE expression in the ORDER BY clause...
"Tallman" <tallman@tlzone.zzn.com> wrote in message
news:3b606e0a.0310150432.6017d977@posting.google.c om...> I have the following MS Access table:
> Name -- Content
> Attributes -- Title
> Shortdesc
> Longdesc
> Synoniemen
>
> Using the next query I retrieve records from the table.
> SELECT Content.Title, Content.ShortDesc, Content.Longdesc,
> Content.synoniemen FROM Content WHERE ((Content.synoniemen LIKE
> '%Blah%') OR (Content.Title LIKE '%Blah%') OR (Content.ShortDesc LIKE
> '%Blah%') OR (Content.longdesc LIKE '%Blah%')) ORDER BY Title;
>
> This query gives me all the records I need but I like to present them
> in a specific order.
> If the searchword is found in the TITLE field it is more important
> then when it is found in the SYNONIEMEN field. The SYNONIEMEN field is
> more important than the SHORTDESC field etc.
>
> Is there a way to present the results in the desired order
> (Title-Synoniemen-Shortdesc-Longdesc) ?
>
> Thanx in advance.
> Tallman
Aaron Bertrand - MVP Guest



Reply With Quote

