Pervasive SQL query
Posted on 2014-07-18
Suppose I am working on a people table.
I want to return the names of people.
I'm looking to prompt the user 3 times (don't ask... long story).
Based on the results of the prompts I'll return:
The names of everyone (Prompts 1, 2 and 3 are 0)
or, if Prompt1 <> 0 those who are Prompt1 years old.
Unless Prompt2 <> 0 then I want all names that are >= Prompt1 and <= Prompt2.
Unless Prompt3 <>0. Then it could be >= Prompt1 and <= Prompt2 AND = Prompt3.
Answers would be, perhaps:
Everyone who is 35
Between 35 and 45
Between 35 and 45 AND all those age 60.
This is actually a construction accounting query that is using cost codes... I just thought that people and ages would be a simpler example to provide.
Using Pervasive 11