Click here to Skip to main content
15,898,035 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Golden Jing22-Nov-09 23:13
Golden Jing22-Nov-09 23:13 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Blue_Boy22-Nov-09 23:29
Blue_Boy22-Nov-09 23:29 
AnswerRe: How to take a number which compare nearby some numbers ? Pin
Shameel22-Nov-09 23:47
professionalShameel22-Nov-09 23:47 
AnswerRe: How to take a number which compare nearby some numbers ? Pin
Luc Pattyn23-Nov-09 1:36
sitebuilderLuc Pattyn23-Nov-09 1:36 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Shameel23-Nov-09 2:16
professionalShameel23-Nov-09 2:16 
AnswerRe: How to take a number which compare nearby some numbers ? Pin
Shameel23-Nov-09 4:00
professionalShameel23-Nov-09 4:00 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Luc Pattyn23-Nov-09 4:28
sitebuilderLuc Pattyn23-Nov-09 4:28 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Roger Wright24-Nov-09 19:04
professionalRoger Wright24-Nov-09 19:04 
I believe the above will order the items by the value of news_id-10, not by their distance from the target value of 30. To do that, you would have to change the ORDER BY clause to

((news_id-10 * new_id-10) - (target_value * target_value)).

It might be easier still to use

ABS(ABS(news_id-10) - ABS(target_value))

though using the function ABS() may slow execution somewhat.

I've been trying to figure out a way to use MIN(ABS(news_id-10) - ABS(target_value)) in a way that will return a record instead of a single value, but I lack the knowledge for that (for now). That would give him the desired information in one step.

"A Journey of a Thousand Rest Stops Begins with a Single Movement"

GeneralRe: How to take a number which compare nearby some numbers ? Pin
Luc Pattyn25-Nov-09 2:21
sitebuilderLuc Pattyn25-Nov-09 2:21 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Roger Wright25-Nov-09 2:47
professionalRoger Wright25-Nov-09 2:47 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Luc Pattyn25-Nov-09 2:52
sitebuilderLuc Pattyn25-Nov-09 2:52 
AnswerRe: How to take a number which compare nearby some numbers ? [modified] Pin
Niladri_Biswas23-Nov-09 3:27
Niladri_Biswas23-Nov-09 3:27 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Golden Jing23-Nov-09 21:36
Golden Jing23-Nov-09 21:36 
AnswerRe: How to take a number which compare nearby some numbers ? Pin
Shameel23-Nov-09 4:59
professionalShameel23-Nov-09 4:59 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Niladri_Biswas23-Nov-09 16:04
Niladri_Biswas23-Nov-09 16:04 
GeneralRe: How to take a number which compare nearby some numbers ? Pin
Shameel23-Nov-09 22:01
professionalShameel23-Nov-09 22:01 
AnswerThanks all of you... Pin
Golden Jing23-Nov-09 21:41
Golden Jing23-Nov-09 21:41 
QuestionSimilarity search in SQL Pin
Jassim Rahma21-Nov-09 9:47
Jassim Rahma21-Nov-09 9:47 
AnswerRe: Similarity search in SQL Pin
T210221-Nov-09 14:17
T210221-Nov-09 14:17 
AnswerRe: Similarity search in SQL Pin
i.j.russell21-Nov-09 14:19
i.j.russell21-Nov-09 14:19 
AnswerRe: Similarity search in SQL Pin
Luc Pattyn21-Nov-09 14:58
sitebuilderLuc Pattyn21-Nov-09 14:58 
AnswerRe: Similarity search in SQL Pin
Niladri_Biswas21-Nov-09 15:44
Niladri_Biswas21-Nov-09 15:44 
AnswerRe: Similarity search in SQL Pin
Shameel22-Nov-09 23:54
professionalShameel22-Nov-09 23:54 
AnswerRe: Similarity search in SQL Pin
David Skelly23-Nov-09 23:05
David Skelly23-Nov-09 23:05 
Questionwhat is the Microsoft SQL Server 2005 Client version? Pin
AJ Hoge20-Nov-09 19:32
AJ Hoge20-Nov-09 19:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.