CDR
04/30/2025, 5:02 PMCeligo AI
04/30/2025, 5:02 PMAI generated answer (using internal Slack threads):To get the subsidiary from selecting from the entity table, you need to join the entity table with the subsidiary table. Here is an example of how you can do this:
sql
SELECT
Entity.name AS "entity_name",
BUILTIN.DF(EntitySubsidiaryRelationship.subsidiary) AS "entity_subsidiary"
FROM Entity
LEFT JOIN EntitySubsidiaryRelationship ON Entity.id = EntitySubsidiaryRelationship.entity
In this query, EntitySubsidiaryRelationship
is the table that holds the relationship between the entity and the subsidiary. The BUILTIN.DF
function is used to get the subsidiary id from the EntitySubsidiaryRelationship
table.
For the case of a kititem, you can use the kititemsubsidiarymap
table to get the subsidiaries. Here is an example:
sql
select * from item JOIN kititemsubsidiarymap ON item.id=kititemsubsidiarymap.item WHERE ...
In this query, kititemsubsidiarymap
is the table that holds the relationship between the kititem and the subsidiaries. The item.id
is joined with kititemsubsidiarymap.item
to get the subsidiaries of the kititem.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/30/2025, 5:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806729317
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804599524
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800812423
Celigo AI
04/30/2025, 5:03 PMCeligo AI
04/30/2025, 5:57 PMCeligo AI
04/30/2025, 5:57 PM