Skip to main content
Topic: mysql: WHERE IN (Read 1146 times) previous topic - next topic

mysql: WHERE IN

When trying to use WHERE .. IN ( ) in the query, it returns the correct results when clicking the Execute in the SET FIELD DATASOURCE window. Same results when running the query in SQLYog (and similar programs).

But when the query is executed by the generated code (even it looks the same as before) it ignores the WHERE  .. IN

This is the query I'm running

SELECT DISTINCT id_item AS VALUE,item_name AS label FROM items WHERE id_item IN (58,59,60,61,62) ORDER BY OrderBy ASC

 

Re: mysql: WHERE IN

Reply #1
Probably it's not a generic problem, but a problem in the NAV FILTER MENU because I tested the same query in other Filters and it works as expected.

EDIT

Happens with all other filters.. the first impression was wrong.

Maybe I'm doing something wrong with the way I add the query to the filters, but the fact is that it works fine when all possible items are showing in the filter menu, and it reflects nicely in the table.