benassi
7 years agoHelper
LIQL not in query
Hi, I was wondering is it possible to do something like the following. Basically i want to exclude a set of id's from the result // get a 604 response SELECT * FROM messages WHERE id != '1' ...
benassi -
Yes, freemarker wouldn't work in this scenario. However, this can be done in any language.
e.g you need to fetch messages expect 13.
SELECT * FROM messages
if( msg.id != 13){ //Do something here }
Also, if this case is only for few messages e.g 10,20. You can use where in query.
SELECT * FROM messages where id in ('1','2','3' and so on)
Thanks Tariq,
Unfortunately doing that select (SELECT * FROM messages) would not be performant as we'd have to pull down all messages and then query. Might have to look at importing the data from community periodically instead and then do our queries.
Cheers