Hello,
I have a music database containing song BPM (Beats Per Minute) data values stored as FLOAT. I need to pull a range of BPM values based on a user-supplied integer. The range should pull all records which are 8% higher and lower than the given integer.
I tried this query for starters:
SELECT
*
FROM
test
HAVING
(
bpm < SUM(100 * 1.08)
) OR (
bpm > SUM(100 * .92)
)
No errors appeared however only one row returned (with bpm value 55.03).
There are approximately 100 records that have a bpm value between 92.00 and 108.00 in the "test" database.
Am I overlooking something obvious?
Yup, your calculations should have used an "AND" instead of an "OR" and you don't need SUM().
For something simple try this:
select * form test where BMP between 100*.92 and 100*1.08
Mike
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]