我有一个多值字段
<arr name="colors">
<str>Blue</str>
<str>Red</str>
<str>Orange</str>
<str>Pink</str>
<str>Violet</str>
</arr>
像这样填充:
<entity name="pub_attributes" query=" SELECT name [description] FROM dbo.Colors">
<field name="colors" column="description" />
</entity>
我需要另一个包含所有颜色的字段,但仅在一行中,由空格分隔,例如
<str name="Colors_All">Bue Red Orange Pink Violet</str>
如果不重新访问颜色表,我怎么能做到这一点?也许是这样的
<entity name="Properites_all" query="
DECLARE @all VARCHAR(MAX)
SET @all = ''
Select @all = @all + ... from '${pub_attributes.colors}'
UNION
Another SELECT that will add more info than just the colors
">
<field name="colors_all" column="description" />
</entity>