Rather simple, I have a one to many / many to one relation and I'd like to query it. However, I don't want any results returned when it isn't provided with any WHERE clause information.
In simpler terms, how do I make a query non-greedy?
Rather simple, I have a one to many / many to one relation and I'd like to query it. However, I don't want any results returned when it isn't provided with any WHERE clause information.
In simpler terms, how do I make a query non-greedy?
You could add a where clause that is always false and append the condition you want supplied with OR:
select * from table where 1 = 0 OR (real conditions)