> For the complete documentation index, see [llms.txt](https://help.holixa.com/holixa-erp-connector/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.holixa.com/holixa-erp-connector/data-interface-reference-manual/reading-data-from-data-interface/another-samples.md).

# Another samples

```
//select all entities within the bulk - the bulk_top (BIT) column is added to identify the top entity in a bulk
SELECT CAST(CASE WHEN EXISTS(SELECT * FROM EcASSOC WHERE EcENTITY.id=EcASSOC.ent_id_child) THEN 0 
ELSE 1 END AS BIT) AS bulk_top, * FROM EcENTITY WHERE bulk_id=@BulkId ORDER BY id DESC

//all association records EcASSOC joined with the child entity attributes (all bulk associations)
SELECT EcENTITY.*, EcASSOC.* FROM EcASSOC LEFT JOIN EcENTITY ON EcASSOC.ent_id_child=EcENTITY.id 
WHERE (EcENTITY.bulk_id=@BulkId)
```

{% hint style="warning" %} <mark style="color:red;">**Warning**</mark>

never update (change) the EcENTITY.comm\_dir value in the bulk ! the whole bulk must have single EcENTITY.comm\_dir value !
{% endhint %}
