SQL Query with "NOT IN" keyword replacement in ES

I need to filter results from my indices based on this scenario:
Select * from TblName where status='ERROR' not in (select * from TbleName where status='OK' )

I am unable to get desired results using must, must not etc.

I guess nobody understood the question?

you must prepare query like

select * FROM TblName where status NOT IN('OK','OK1')

Sorry I didn't got your logic. Can you please elaborate a little. :frowning:

As far as I know, Elasticsearch SQL does not support sub-selects.

It doesn't matter its SQL or elastic search query. I need a solution for this logic:
ES Logic

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.