Subject RE: Query help needed, use a LIMIT
Author James Calfee
SELECT LIMIT 1 V2
FROM TABLE_WITH_V
WHERE V1 <= ?
ORDER BY V1 DESC

-----Original Message-----
From: Rick Debay
Sent: Monday, February 05, 2007 12:54 PM
To: InformationTechnology
Subject: FW: Query help needed


A No-Prize if you can answer before the support forum.

-----Original Message-----
From: Rick Debay
Sent: Monday, February 05, 2007 12:54 PM
To: 'firebird-support@yahoogroups.com'
Subject: Query help needed

Given the number 25, I'd like to get the value 'B' back from the
following (simplified) table:

V1 V2
-- --
10 A
20 B
30 C

Numbers 30 and above should return 'C', and numbers below 20 should
return 'A'.
This should be simple, but I just can't think today.

Thanks, Rick DeBay

Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.