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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -