I have a question regarding the JSP mapper condition.

Asked 2 weeks ago, Updated 2 weeks ago, 1 views

I'm developing a shopping mall web.

I'd like to add a page-nation function to the page that displays the latest products.

Then condition in the mapper is

I think we need to add 2 more.

<select id="navNewList" resultType="ShoesVO" parameterType="hashmap">
     SELECT *
     FROM goods_2
     WHERE release_date>=SYSDATE
     WHERE num BETWEEN #{start} AND #{end}
   </select>

Is it right to give two WHERE conditional sentences?

Actually, it didn't work when I did it.

If you can edit it, please answer<

sql mybatis jsp java

2022-09-20 08:40

1 Answers

Run queries separately with DBMS tools such as the debiver https://dbeaver.io/ and check for query errors.

If you look at the query you created, there are two WHERE clauses at the same level, but they cannot be executed. Change the second WHERE to AND.

Actually, I don't think I'll get what I want even if I do that..


2022-09-20 08:40

If you have any answers or tips


© 2022 pinfo. All rights reserved.