oracle - to assign [vehicle_type = all types] when no filter is selected -


i have extract table based on user input, have table named "vehicle_register" vehicle details , users allowed filter data using vehicle type(car, bus, truck...). if no filer selected data should displayed.

now have use 2 queries, 1 filter , 2 all, 1. select * vehicle_register vehicle_type = 'car'; 2. select * vehicle_register;

can these 2 queries merged, want know how use conditional clause using "case" or "if" statement assign [vehicle_type = types] when no filter selected.

try this:

select *  vehicle_register (vehicle_type = mycar or mycar null); 

where mycar variable filter (can empty if not set up).


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -