Remove where clause from query depending on a specific value

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 796 Views - Last Post: 03 August 2016 - 10:24 AM

#16 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 09:49 AM

As I was indicating - using parentheses to group conditions you can short circuit latter chunks of the conditions.

Quote

((IF gender IS NOT NA) AND (IF gender matches the requirements))

The second half only evaluates if the first half is true.
Was This Post Helpful? 0
  • +
  • -

#17 alinabb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-August 16

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 09:55 AM

is it possible to write if statement in oracle sql?
Was This Post Helpful? 0
  • +
  • -

#18 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 09:58 AM

*sigh* 'if', in this case, is to make the logic for the WHERE clause sound right when verbalizing it. There is no actual 'if'.. just implied.
Was This Post Helpful? 0
  • +
  • -

#19 alinabb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-August 16

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:00 AM

I'm confused. How should i write this?
Was This Post Helpful? 0
  • +
  • -

#20 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:03 AM

Like a stinking WHERE clause. WHERE clause conditions are implied IFs. "If x is true and if y is true and if Z is true.. ". I am not going to write the exact query out.. I mean I think I may have written too much of it out already.
Was This Post Helpful? 0
  • +
  • -

#21 alinabb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-August 16

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:05 AM

Ok I will try to figure out how to write it and let you know

just tell me something do i need to use the keyword decode to do this?
Was This Post Helpful? 0
  • +
  • -

#22 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:07 AM

Keyword? Decode?
Was This Post Helpful? 0
  • +
  • -

#23 alinabb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-August 16

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:17 AM

yes in oracle sql , you have this keyword
Was This Post Helpful? 0
  • +
  • -

#24 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,476
  • Joined: 12-June 08

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:21 AM

I feel like I am about to jump into some Abbot/Costello joke. :rolleyes:
Was This Post Helpful? 0
  • +
  • -

#25 alinabb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 02-August 16

Re: Remove where clause from query depending on a specific value

Posted 03 August 2016 - 10:24 AM

okay :(
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2