252
Views
3
Comments
usage of sql in aggregate
Question

Hi,

How can we use IN SQL query in aggregate

2024-03-25 10-26-49
Miguel Marçal

Ronan T wrote:

Hi,

How can we use IN SQL query in aggregate

Hi Ronan,

Please check this out to see if it helps: https://www.outsystems.com/forums/discussion/30747/how-to-loop-in-aggregate-similar-to-sql-in-clause/


Best regards,

Miguel Marçal


2019-06-15 21-39-22
Afonso Carvalho
 
MVP

You can't do an IN clause using an aggregate. You'll have to write your own SQL in an Advanced Query if you need it.

There are a couple of ways to reach the same result you would obtain with an IN clause, namely manipulating the List of results like in Miguel's link, or using a calculated attribute in the Aggregate to determine if the record is what you want:

But both methods will be less performant than an actual SQL query, so make sure to evaluate the effort needed for your query.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Also, make sure to vote for this Idea.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.