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
Post a Comment