简体   繁体   English

"灵活的搜索问题 SAP Hybris"

[英]Flexible Search Issue SAP Hybris

I have a problem with a Flexible Query.我对灵活查询有疑问。 This is my query:这是我的查询:

Select
{pp.productCode} as 'Code',
{p.descriptionCics} as 'Desc CISC',
{bs.uid} as 'Store',
{evo.code} as 'Status', 
{p.department} as 'Department', 
{pca.name} as 'Category',
{p.grm} as 'GRM',
{p.buyerCode} as 'Code Buyer',
{p.buyerids} as 'Buyer', 
{ps.planogramCode} as 'Code Planogram',
{pca.categoryCode} as 'Category Planogram',
{s.puvmBlock} as 'Blocked',
(CASE WHEN ({p.productDetailTypeList} is not null )THEN 'YES' else 
'NO' END) as 'IMAGE'
from 
{ 
Product as p
JOIN PlanogramProducts as pp on {p.code} = {pp.productCode}
JOIN StockLevel as s on {pp.productCode} = {s.productCode}
JOIN EnumerationValue as evo on {p.status} = {evo.pk}
JOIN PlanogramCategory as pc on {pp.planogramCode} = 
 {pc.planogramCode}
JOIN PlamnogramCategoryAnag as pca on {pc.categoryCode}= 
{pca.categoryCode}
JOIN BaseStore as bs JOIN PlanogramStore as ps on {bs.storeRef} = 
{ps.storeRef} AND {bs.bramchOffice} = {ps.branchOffice}
}
WHERE 1=1

Your statement contains errors.您的陈述包含错误。 You join basestore with planogramStore.您通过 planogramStore 加入 basestore。 But neither planogram store, nor basestore is joined with any other part of your query.但是,货架图存储和基本存储都不会与查询的任何其他部分连接。 You need to join basestore or planogramstore with one of the other tables.您需要将 basestore 或 planogramstore 与其他表之一连接起来。

Now you have 2 detached parts in your from statement, which is why you are getting errors现在您的 from 语句中有 2 个分离的部分,这就是您收到错误的原因

Product as p
JOIN PlanogramProducts as pp on {p.code} = {pp.productCode}
JOIN StockLevel as s on {pp.productCode} = {s.productCode}
JOIN EnumerationValue as evo on {p.status} = {evo.pk}
JOIN PlanogramCategory as pc on {pp.planogramCode} = 
 {pc.planogramCode}
JOIN PlamnogramCategoryAnag as pca on {pc.categoryCode}= 
{pca.categoryCode}

and

JOIN BaseStore as bs JOIN PlanogramStore as ps on {bs.storeRef} = 
{ps.storeRef} AND {bs.bramchOffice} = {ps.branchOffice}

you need to have a join between these 2 parts to get the correct data您需要在这两个部分之间进行连接才能获得正确的数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM