Mehmet Seflek
12/09/2022, 10:52 PMvendor
table and the entity
table with entity.type = 'Vendor'
. In particular, if we join the entity
table to the transaction
table, the we see that there are many expense transactions associated with entities that have type Vendor
but where transaction.vendor
is null.Shai Coleman
12/12/2022, 1:00 PMentity
table is for fields that are common for vendors and customers.
The vendor
table is for things that are specific for vendors. You need to join both, e.g.
SELECT transaction.id AS transaction_id,
entity.externalid AS entity_externalid,
entity.entitytitle AS entity_entitytitle,
BUILTIN.DF(vendor.category) AS vendor_category_name
FROM transaction
LEFT JOIN entity ON (entity.id = transaction.entity)
LEFT JOIN vendor ON (vendor.id = transaction.entity)
FETCH FIRST 5 ROWS ONLY