informix : dynamic condition in where clause -


I want to write a query in which I would like condtions in the WHERE section which is dependent on the values, for example, if I have There is a student table with student student ID, name, age, postcode, num_subjects_enrolled

column, so I want to get all the names that live in the students. Post_code = 'POSTCODE' and (if they take more than one topic, I want to filter by age & lt; 20 other ages> 20)

I want to do all in a single query.

I am using informix and any help is appreciated.

I think you can make it with something and and Select OR argument:

  Student from where the postal code is post_code = '12345' and ((num_subjects_enrolled & gt; 1 and age & lt; 20) or ( Num_subjects_enrolled & lt; = 1 and age> = 20))  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -