Home  >  Q&A  >  body text

spring - Regarding the problems encountered in keyword query: the problem of writing sql statements into java

I am a database novice. My senior assigned me a keyword query task. I encountered some problems when writing the database query statement.

select * from COMPLIANCE_CONSULT where CONSULT_TITLE like '%keyword%'or CONSULT_CONTENT like '%keyword%'or REPLY_CONTENT like '%keyword%'or REPLY_ATTACH like '%keyword%'

This is the sql query statement I wrote. Now I need to write it into the code and write it like this

This is the original keyword query, but I need to write four query conditions. If it is written like this, what should it look like, or what should the format be like?

为情所困为情所困2702 days ago841

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-27 17:43:38

    Change "and" in jpql to "or"

    reply
    0
  • 某草草

    某草草2017-05-27 17:43:38

    The pair returned upstairs can be optimized. String string splicing takes up memory. You can use stringBuilder.append for splicing

    reply
    0
  • Cancelreply