Understanding relational table queries counts
How you build a relational table query can have a drastic affect on your query criteria count.
It is important to note that this article relates to building a query that cross checks contacts in your database who have rows in a relational table. In the below example, the Database/RT UID is used to match contacts.
Database Recipient ID |
Database/RT UID |
Is In RT COLOR? |
RTRoom1Color |
RTRoom2Color |
RTRoom3Color |
1 |
1111 |
Yes |
Red |
Blue |
Yellow |
2 |
2222 |
Yes |
Red |
Blue |
Yellow |
3 |
3333 |
Yes |
Red |
Blue |
Orange |
4 |
4444 |
Yes |
Red |
Orange |
Yellow |
3 |
3333 |
Yes |
Red |
Orange |
Yellow |
Query approaches
Criteria 1:
In Relational Table: Color
WHEN (RTRoom1Color is equal to Red
AND RTRoom2Color is equal to Blue)
AND RTRoom3Color is equal to yellow
VS
Criteria 2:
In Relational Table: Color
WHEN (RTRoom1Color is equal to Red
AND RTRoom2Color is equal to Blue)
AND
In Relational Table: Color
WHEN RTRoom3Color is equal to yellow
In Criteria 1, We are asking for specific contacts (UID's) in the database who have a presence in the Relational Table where a single Row of relational table data must meet all criteria for a UID. In this case, Recipient ID 1 and Recipient ID 2 meet the criteria of the query where all 3 conditions are met. It is being very selective.
Criteria 2 however is not as selective and will allow a combination of Relational Table rows that belong to a single database recipient ID to match the criteria.
For example, if there are 2 records in the relational table that match to a contact in the database, the 2 records can be combined because they both relate to the same contact.
Using the above table, Recipient ID 1, Recipient ID 2 and Recipient ID 3 (through a combination of 2 rows of data) meet the conditions of Criteria 2.