Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL statement
Message
From
22/12/2003 19:57:07
 
 
To
22/12/2003 19:12:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00861465
Message ID:
00861468
Views:
23
>Hi ppl,
>
>I need a little help with a sql statement
>
>I have 8 fields like this q1a,q1b,q1c,q1d,q2a,q2b,q2c,q2d
>
>each field is int()
>values can be from 0 to 4
>
>I need to only return a result set if 2 of the q1's values are greater than 2 or 2 of the q2's values are greater than 2
>
>This will be running as a stored proc in SQL
>
>
>Thanks in advance
>
>Paul

about the only thing i can think of is
select * from theTable where
 (q1a > 2 and q1b > 2) or (q1a > 2 and q1c > 2) or (q1a > 2 and q1d > 2) or
 (q1b > 2 and q1c > 2) or (q1b > 2 and q1d > 2) or
 (q1c > 2 and q1d > 2) or
 (q2a > 2 and q2b > 2) or (q2a > 2 and q2c > 2) or (q2a > 2 and q2d > 2) or
 (q2b > 2 and q2c > 2) or (q2b > 2 and q2d > 2) or
 (q2c > 2 and q2d > 2)
tried to think of something more mathematical, but ...
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform