Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

field1 = decode(:my_param,0,NULL,NOT NULL)

Hi,
 on Oracle 10
How can I write the above SQL query correctly?

If my parameter = 0 then
   return all the NULL values
Else
  return all the NOT NULL

Thanks
0
peledc
Asked:
peledc
1 Solution
 
sdstuberCommented:
WHERE  (( :my_param = 0 and field1 is null)
or (:my_param != 0 and field1 is not null))
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now