How to retrieve data with in related column in this senario

im having trouble understanding why this search doesn’t return data

i have a table A with a column type relation named B_link to table B

if i use this search query it will not return the expected result

B_link.objectId = 'test' AND B_link.objectId = 'test2'

even if there is a record in table A that have a relation with 2 records from table B

Hello @mohammad_altoiher!

The query B_link.objectId = 'test' AND B_link.objectId = 'test2' is trying to find a record where the B_link.objectId is both ‘test’ and ‘test2’ at the same time, which isn’t possible.
If you’re looking for records related to either ‘test’ or ‘test2’ in table B, you should use B_link.objectId = 'test' OR B_link.objectId = 'test2'.


but this with return records where only one B object in the relation

how can i return only the records in table A where there is both B objects in the relation? is there a solution?

Since SQL creates a table that is a combination of A and B, and then processes each record in the table, each record can never have two relations in a single row. It’s always a single related object. If ‘A’ has two related objects, then there will be two separate records in the result, not just one. To achieve a single record result, we use the group by operator.

Based on this, you can create a query using the REST Console as follows:

As a result, you will get the following URL:



1 Like