I want to do a Query like this:
v_name VARCHAR2(60); SELECT * FROM book WHERE name = v_name
But if "v_name" is NULL, the program must be:
SELECT * FROM book
I don't wan't to set the filter in the WHERE condition. If v_name is NULL i dont want to get all the recodrs with name=NULL, but ALL the records.
I have tried this:
SELECT * FROM book WHERE name (CASE WHEN v_name IS NULL THEN name ELSE v_name END);
But it doesn't work.
Thanks.