In Liferay dynamic query you can create a query for not in condition like

 

 

SELECT * FROM traders WHERE traderId NOT IN(455,466)
dynamicQuery.add(PropertyFactoryUtil.forName("primaryKey.traderId")
.notIn(StatutoryLocalServiceUtil.dynamicQuery()      
.add(PropertyFactoryUtil.forName("primaryKey.traderId").eq(455))      
.add(PropertyFactoryUtil.forName("primaryKey.traderId").eq(456))      
.setProjection(ProjectionFactoryUtil.property("primaryKey.traderId"))));