On Tue, 11 Dec 2001 14:06:08 -0600, [EMAIL PROTECTED] wrote: >SELECT t1.gasday t1.co2_fuel_counter t2.gasday t2.co2 _fuel_counter from >daily_data t1, + >daily_data t2 where t1.gasday = t2.gasday-1
RULE 'co2 Fuel Counter cannot be less than previous day' + FOR daily_data SUCCEEDS + WHERE (co2_fuel_counter >= + (SELECT co2_fuel_counter FROM daily_data t2 + WHERE t2.gasday = (daily_data.gasday - 1))) A small performance warning: this rule cannot use an index to find yesterday, because of the expression to compute yesterday's date, so when you have a lot of data in the table, it will slow data entry. Bill ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l
