Menu

Issues with the clause "IN"

Help
Malouda
2015-07-11
2015-07-12
  • Malouda

    Malouda - 2015-07-11

    Hi,

    I'm trying to use the clause "IN" in one of my SQL requests (a classic "table in ("arg1", "arg2")). But, I don't know why, it doesn't seem to work. The thing that strikes me is that It does work when I use two requests (one with table == "arg1" and one with table == "arg2") and then use Union ALL. Did any of you have the same issue?

     

    Last edit: Malouda 2015-07-11
  • Marco Amadei

    Marco Amadei - 2015-07-12

    "In" clause works perfectly. If you need our help, you should provide a complete code example and the stack trace of the exception you get, other than the behaviour you expected .
    For now, we can just notice that your use of sql is wrong:

    not table in ("arg1", "arg2") but column in ("arg1", "arg2").

    == is THE "Equal to" operator in java, not in SQL

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.