Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8750759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:55:22+00:00 2026-06-13T12:55:22+00:00

Having this where clause : The first and second placeholder ? can have values

  • 0

Having this where clause :

The first and second placeholder ? can have values : 1 || NULL
The third place holder is dynamically added (array)

IF(ISNULL(?),1,xy.id) IN 
     (IF(ISNULL(?),1,(SELECT x.id FROM x WHERE name IN (?))))   

I need this type isnull checking because i want the clause to always return true if data sent is null. Basically if data is null clause will be 1 IN 1 , if its not null find the corespondent ids , but if() function limits me to return only 1 result (not a set) .What options do i have here except dynamically build the whole query in php ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:55:23+00:00Added an answer on June 13, 2026 at 12:55 pm

    You can do this in your where clause

    WHERE (ISNULL(?) OR xy.id IN (SELECT x.id FROM x WHERE name IN (?)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having this code: $main = !empty($searchResults['main']) ? $searchResults['main'] : null; $second = !empty($searchResults['second']) ?
Using the zend framework i have used a query,having a IN clause,this is my
I have this method, that can return three different response. At first, it was
I'm having trouble using variables in my SQL WHERE clause. I'm getting this error:
I'm having problem with this function in Java. I don't understand why when lastNodeAttributes==null
having trouble coming up with search parameters for this issue, so I can't find
Having this (simplified) XML: <?xml version=1.0 encoding=UTF-8?> <kml> <Document> <Placemark> <name>Poly 1</name> <Polygon> <coordinates>
Having this errors when trying to compile/run my app using Maven. I've succeeded to
Having this text file : Breathing 1:-29.9396 9:-32.0895 13:-35.6787 2:-36.8527 17:-37.3622 8:-38.0584 14:-38.5265 18:-38.7567
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.