Three Numbers

editolis

Panathinaikos Fun
Local time
Tomorrow, 01:27
Joined
Oct 17, 2008
Messages
107
Three Numbers dif

Hi all,

I need your help solving the following issue.

I have enclosed db with one table.

1. I want to make a query to show me the following results.

For column ctA for example:

I want the query to show me the differences between the three columns. To have at list >= 3 numbers difference.

For Example:

CtA=5, ctB=0, ctC=2 or

CtA=4, ctB=1, ctC=0 or

CtA=3, ctB=0, ctC=0 etc.


2. And to make my issue more complicate I want another column show me bigger differences when the columns ctA, ctB, ctC have values >=6.

In that case I do not want only >=3 but the difference >=6.

For Example:

CtA=20, ctB=14, ctC=14 or

CtA=11, ctB=5, ctC=5 or

CtA=18, ctB=12, ctC=5 etc.

Thank you in advance for your help.
 

Attachments

Last edited:
BAsically you have 3 columns A, B, and C.

What do you mean "difference between 3 columns"? A "difference" is between two values, not three, so this is not clear.

Also, can we assume that column A always has the highest value?
 
BAsically you have 3 columns A, B, and C.

What do you mean "difference between 3 columns"? A "difference" is between two values, not three, so this is not clear.

Also, can we assume that column A always has the highest value?

I Am sorry for my english Jal.

I am talking about all three columns to find the differences.

And yes, lets assume that Column A has the highest values.
 
As a sample:

SELECT ColumnA - ColumnB AS [A-B], ColumnA - ColumnC AS [A-C]
FROM Table1

Does that get you started?
 
As a sample:

SELECT ColumnA - ColumnB AS [A-B], ColumnA - ColumnC AS [A-C]
FROM Table1

Does that get you started?

This is a good start.

Sometimes the simplest thinks are in front of your eyes.

I Will get back to you if i need anything extra.

Thank you jal.
 

Users who are viewing this thread

Back
Top Bottom