如何将参数与多个字段进行匹配

时间:2019-07-15 06:54:08

标签: parameters birt

我已经在BIRT中创建了一个静态(字符串)参数,并希望将该参数与多个字段进行匹配。.

如果我使用此问题随附的代码,则报告不会运行。如何将参数与多个字段进行匹配?

感谢先进

Select
wp_posts.post_type,
wp_postmeta.meta_value As `ingredient 1`,
wp_postmeta1.meta_value As `ingredient 2`,
wp_postmeta2.meta_value As `ingredient 3`,
wp_postmeta3.meta_value As `ingredient 4`,
wp_postmeta4.meta_value As `ingredient 5`,
wp_postmeta5.meta_value As `ingredient 6`,
wp_postmeta9.meta_value As `ingredient 7`,
wp_postmeta8.meta_value As `ingredient 8`,
wp_postmeta6.meta_value As `ingredient 9`,
wp_postmeta7.meta_value As `ingredient 10`,
Date(wp_postmeta10.meta_value) As productiedatum,
Date(wp_postmeta11.meta_value),
wp_posts.post_title As Productnaam
From
wp_posts Inner Join
wp_postmeta On wp_postmeta.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta1 On wp_postmeta1.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta2 On wp_postmeta2.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta3 On wp_postmeta3.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta4 On wp_postmeta4.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta5 On wp_postmeta5.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta6 On wp_postmeta6.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta7 On wp_postmeta7.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta8 On wp_postmeta8.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta9 On wp_postmeta9.post_id = wp_posts.ID Inner Join
wp_postmeta wp_postmeta10 On wp_posts.ID = wp_postmeta10.post_id Inner 
Join
wp_postmeta wp_postmeta11 On wp_posts.ID = wp_postmeta11.post_id
Where
wp_posts.post_type = 'product' And
wp_postmeta.meta_key = 'ingredient1' And
wp_postmeta1.meta_key = 'ingredient2' And
wp_postmeta2.meta_key = 'ingredient3' And
wp_postmeta3.meta_key = 'ingredient4' And
wp_postmeta4.meta_key = 'ingredient5' And
wp_postmeta5.meta_key = 'ingredient6' And
wp_postmeta9.meta_key = 'ingredient7' And
wp_postmeta8.meta_key = 'ingredient8' And
wp_postmeta6.meta_key = 'ingredient9' And
wp_postmeta7.meta_key = 'ingredient10' And
wp_postmeta10.meta_key = 'productiedatum' And
wp_postmeta11.meta_key = 'houdbaarheidsdatum' And
wp_postmeta.meta_value = ? or 
wp_postmeta1.meta_value = ? or
wp_postmeta2.meta_value

等等。

结果应该是在wp_postmeta.meta_value字段之一中具有参数值的所有产品

0 个答案:

没有答案