diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleListingQuery.java
index 54eae52695203782f45edef744f7a38735d002af..4507cb82e33236a334dd71569244893e873acdaf 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleListingQuery.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleListingQuery.java
@@ -217,11 +217,12 @@ public interface ISampleListingQuery extends TransactionQuery, IPropertyListingQ
     @Select(sql = "select s.id, s.perm_id, s.code, s.expe_id, s.grou_id, s.dbin_id, "
             + "       s.registration_timestamp, s.pers_id_registerer, "
             + "       s.samp_id_generated_from, s.samp_id_part_of, s.saty_id, s.inva_id "
-            + "   from samples s where s.saty_id=?{1} and id in ("
+            + "   from samples s where s.saty_id=?{1} and id s.in ("
             + "       select samp_id from sample_properties sp where sp.stpt_id in ("
             + "              select id from sample_type_property_types stpt where stpt.prty_id = "
             + "                     (select id from property_types where code=?{2})"
-            + "              ) and value=?{3}" + "       ) and not id = any(?{4})", parameterBindings =
+            + "              ) and value=?{3}                                      "
+            + "       ) and not id = any(?{4})", parameterBindings =
         { TypeMapper.class, TypeMapper.class, TypeMapper.class, LongSetMapper.class }, fetchSize = FETCH_SIZE)
     public DataIterator<SampleRecord> getSamplesWithPropertyValue(long sampleTypeId,
             String propertyTypeCode, String propertyValue, LongSet sampleIds);