473,216 Members | 1,238 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,216 software developers and data experts.

ORDER BY 5*(column LIKE ' term') + 4*(column LIKE ' term')

I am trying to find some documentation on using things like ORDER BY
5*(column LIKE ' term') + 4*(column LIKE ' term')

I don't even know what it is called so it is difficult to search. My
questions is... Is the value before the * like a multiplier? So I could
give more weight to one column than another by raising that number?

I am trying to return a result that searches 5 or 6 columns and column
1 needs to have by far the most weight, 2 the second amount of weight
and so on. I thought this worked but lets say i am searching for the
word "cooking" like below

Order By 6*(book_title LIKE '%cooking"%') + 5*(book chapter LIKE
'%cooking%') + 4*(book_author LIKE '%cooking%') + 3*(book_text LIKE
'%cooking%') + 2*(book_publisher LIKE '%cooking%') +
1*(book_pulish_date) desc

The problem is if the word "cooking" is in the book_title once, but in
the book_text like 20 times, the book_text is returned first, i always
want the title to have more precedence even if it only contains
"cooking" once.

Thanks for any help.

Chad

Sep 12 '06 #1
0 2295

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

Similar topics

2
by: Laurence Breeze | last post by:
Is it possible to add a column to a table using the "alter table" statement and specify where in the sequence of columns the new column sits. If not is there any way to alter the order of columns...
18
by: war_wheelan | last post by:
I am very new to Transact-SQL programming and don't have a programming background and was hoping that someone could point me in the right direction. I have a SELECT statement SELECT FIXID,...
10
by: Ed | last post by:
The page I'm working on is at http://www.coldpizzasoftware.com/temp/layout.html I trying to get the yellow sidebar to go in the white area to the right of the green content area and between the...
10
by: OtisUsenet | last post by:
Hello, I am trying to select distinct dates and order them in the reverse chronological order. Although the column type is TIMESTAMP, in this case I want only YYYY, MM, and DD back. I am...
1
by: Thomas Schoen | last post by:
Hi, is it possible to use a parameter of a plpgsql-function to order a selection inside the function? What i would like to do is pass a column-name/alias-name to a plpgsql function and use...
3
by: Beowulf | last post by:
I was just messing around with some ad hoc views and table returning UDFs today so I could look at and print out data from a small table and noticed something strange. If I stick my select...
3
by: andreas ames | last post by:
Hi all, recently I came across a line of code like the following: if seq.erase(seq.begin(), seq.end()) != seq.end() /* ... */ It made me wonder if this is just bogus or if it even can...
7
by: jknaty | last post by:
I'm trying to create a function that splits up a column by spaces, and I thought creating a function that finds the spaces with CHARINDEX and then SUBSTRING on those values would an approach. I...
0
by: ThereYouAre | last post by:
I'm trying to compare input data to what's stored on a DB2 table to see if there's a match, but DB2 stores the term I want to look for in the input field. Table: TERM_TABLE Column: TERM_COLUMN...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.