sql - Simplifying WHERE clause -


is there way simplify statement 1 has declare airport , storename once , let category , fixture vary?

select *  product_display (airport = 'jfk' , storename = 't3' , category = 'pralines' , fixture '%w15%')  or (airport = 'jfk' , storename = 't3' , category = 'kinder' , fixture '%w12%')  or (airport = 'jfk' , storename = 't3' , category = 'nutella' , fixture '%g04%')  or (airport = 'jfk' , storename = 't3' , category = 'tic tac' , fixture '%w12%') 

you can simplify below

select *  product_display airport = 'jfk' , storename = 't3' , ((category = 'pralines' , fixture '%w15%')  or (category = 'kinder' , fixture '%w12%')  or (category = 'nutella' , fixture '%g04%')  or (category = 'tic tac' , fixture '%w12%')) 

hope out.


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -