具备以下结构:
https://i.stack.imgur.com/3fKp8.png”rel=“nofollow noreferer”>Data structure
I m试图调查BCA_Category 载于的可能数值中的情况。 Offering_Cust_Cat 栏,指出每个<>strong>BPI_ID都在列举所有可能的Offering_Cust_Cat。 因此,我们应当把BPI_ID作为搜索的关键。
我提出了以下询问,以分类所有数据,并生成一个最后一栏:indicator至。 不列颠及北爱尔兰联合王国 Offering_Cust_Cat 然而,其价值并未与所有可能的价值相比较。
select no.object_id bpi_id, no.name bpi_name, nr.reference offering, nr2.reference offering_cust_cat, nr3.reference bca, nr4.reference bca_category,
case when nr4.reference in nr2.reference then BCA Category is same
ELSE BCA category is not same
END as indicator
from nc_objects no
inner join nc_references nr on nr.object_id = no.object_id and nr.attr_id = 9126099920013458621 /* Product Offering */
inner join nc_references nr2 on nr.reference = nr2.object_id and nr2.attr_id = 9132199382713895167 /* Customer Category */
inner join nc_references nr3 on nr3.object_id = no.object_id and nr3.attr_id = 9149183862513001518 /* CA of Associated Product */
inner join nc_references nr4 on nr4.object_id = nr3.reference and nr4.attr_id = 7030151465013152898 /* Customer Category */
where no.object_type_id = 9126083628313449001 /* Business Product Instance */