OR OR IN V2K Do you ever get tired of trying to evaluate an expression for multiple values? Minimize your workload by taking advantage of the IN clause within SQL statements. Assume that you are writing a simple statement/procedure to determine whether you do business in a particular state. Follow the simple scenario below to see how the IN clause can ease your pain. Given a scenario in which you do business only in the states of Georgia, Kentucky, Tennessee, Florida, and Virginia, evaluate the following. DECLARE @State CHAR(2) SET @State = 'CO' IF @State = 'GA' OR @State = 'KY' OR @State = 'TN' OR @State = 'FL' OR @State = 'VA' PRINT 'We do business in the state of ' + @State ELSE PRINT 'We do NOT do business in the state of ' + @State The long evaluation of the @State variable can prove cumbersome to type and to read. Consider using the IN clause in place of multiple ORs. SET @State = 'KY' IF @State IN ('GA','KY','TN','FL','VA') PRINT 'We do business in the state of ' + @State ELSE PRINT 'We do NOT do business in the state of ' + @State Another option is to create a ValidState table and select the valid state values via a query to avoid hard coding within your application. SET @State = 'FL' IF @State IN (SELECT State FROM ValidState) PRINT 'We do business in the state of ' + @State ELSE PRINT 'We do NOT do business in the state of ' + @State In the preceding example, the IN clause behaves like multiple ORs. The IN clause is much easier to type and read, however, and is useful within queries. ----------------------------------------