I've a query like this one:
SELECT IF(@param = 42, 'static', SELECT ... );
But it doesn't work because I can't insert a SELECT statement inside a IF(). My problem is that I can't do otherwise (use an if-then statement outside sql) because to "architecture restrictions".
Any solution to select if evaluate or not a query based to parameter value?
IFinside the query. If...isfoo FROM baryou getSELECT (case when @param = 42 then 'static' else foo end) FROM bar.