C
Cross-eyed
I have a table of over 6,000 records. For one of my queries I am havin
to return the rows that have a "fold change" greater than som
predefined number (1.5, 2, 3, or 4). A fold change is determined b
dividing the largest number in an row by the smallest number in a row.
For example:
---------------------------------
ID | test_1 | test_2 | test_3
---------------------------------
exp_1 | 18 | 25 | 30
exp_2 | 52 | 127 | 39
Experiment 1 has a fold change of 1.67. This is done by taking th
largest value of the three tests (30), and a dividing it by th
smallest of the three (18). (30/18 = 1.66667)
Experiment 2 has a fold change of 3.26. (127/39 = 3.2564)
I need a SELECT statement that would return all (*) information on
row WHERE the fold change is greater than or equal to (>=) th
predefined number.
For instance:
---------------------------------
ID | test_1 | test_2 | test_3
---------------------------------
exp_1 | 18 | 25 | 30
exp_2 | 52 | 127 | 39
exp_3 | 24 | 12 | 52
exp_4 | 7 | 23 | 18
exp_5 | 87 | 123 | 80
exp_6 | 79 | 39 | 41
exp_7 | 24 | 12 | 5
exp_8 | 74 | 78 | 82
Let's say the predefined number was 3.
-Therefore the SQL Query would return all (*) information for exp_2
exp_3, exp_4, and exp_7.
If the predefined number was 4 then,
-the SQL Query would return all information for exp_3 and exp_7
If the predefined number was 1.5 then it would return all rows excep
exp_8.
The following query would work but I can't use LEAST and GREATEST. I'
running this as a web application using ASP and an Access database.
SELECT * FROM my_table WHERE
GREATEST(test_1, test_2, test_3)/LEAST(test_1, test_2, test_3)
redefined_number;
Does anyone have any suggestions
to return the rows that have a "fold change" greater than som
predefined number (1.5, 2, 3, or 4). A fold change is determined b
dividing the largest number in an row by the smallest number in a row.
For example:
---------------------------------
ID | test_1 | test_2 | test_3
---------------------------------
exp_1 | 18 | 25 | 30
exp_2 | 52 | 127 | 39
Experiment 1 has a fold change of 1.67. This is done by taking th
largest value of the three tests (30), and a dividing it by th
smallest of the three (18). (30/18 = 1.66667)
Experiment 2 has a fold change of 3.26. (127/39 = 3.2564)
I need a SELECT statement that would return all (*) information on
row WHERE the fold change is greater than or equal to (>=) th
predefined number.
For instance:
---------------------------------
ID | test_1 | test_2 | test_3
---------------------------------
exp_1 | 18 | 25 | 30
exp_2 | 52 | 127 | 39
exp_3 | 24 | 12 | 52
exp_4 | 7 | 23 | 18
exp_5 | 87 | 123 | 80
exp_6 | 79 | 39 | 41
exp_7 | 24 | 12 | 5
exp_8 | 74 | 78 | 82
Let's say the predefined number was 3.
-Therefore the SQL Query would return all (*) information for exp_2
exp_3, exp_4, and exp_7.
If the predefined number was 4 then,
-the SQL Query would return all information for exp_3 and exp_7
If the predefined number was 1.5 then it would return all rows excep
exp_8.
The following query would work but I can't use LEAST and GREATEST. I'
running this as a web application using ASP and an Access database.
SELECT * FROM my_table WHERE
GREATEST(test_1, test_2, test_3)/LEAST(test_1, test_2, test_3)
redefined_number;
Does anyone have any suggestions