是否可以让 SQL Server 转换一组结果中的条目列

发布于 2024-08-13 07:14:40 字数 837 浏览 4 评论 0原文

我有以下设置...

Table: properties
p_id [pk]
p_propname
o_id_owners [fk]

Table: owners
o_id [pk]
o_extcode
o_fname
o_lname

Table: selectedfeatures
s_id [pk]
d_id_features [fk]
p_id_properties [fk]

Table: features
d_id [pk]
d_code
d_featurename
g_id_featuregroup [fk]

Table: featuregroup
g_id [pk]
g_featuregroupname

理想情况下,我希望它输出

<header> Owner name | Owner Extcode | Prop name | [GROUP NAMES (featuregroup)] 
<row> Owner name | Owner Extcode | Prop name | ^feature code | ^feature code | 

我正在努力解决的组名称位;这些表是链接的,我可以这样显示记录:

<header> Owner name | Owner Extcode | Prop name | Feature Name
<row> Owner name | Owner Extcode | Prop name | Feature Name
<row> Owner name | Owner Extcode | Prop name | Feature Name

I have the following setup...

Table: properties
p_id [pk]
p_propname
o_id_owners [fk]

Table: owners
o_id [pk]
o_extcode
o_fname
o_lname

Table: selectedfeatures
s_id [pk]
d_id_features [fk]
p_id_properties [fk]

Table: features
d_id [pk]
d_code
d_featurename
g_id_featuregroup [fk]

Table: featuregroup
g_id [pk]
g_featuregroupname

Ideally I want it to output

<header> Owner name | Owner Extcode | Prop name | [GROUP NAMES (featuregroup)] 
<row> Owner name | Owner Extcode | Prop name | ^feature code | ^feature code | 

Its the group names bit I'm struggling with; The tables are linked and I can get the records to display thus:

<header> Owner name | Owner Extcode | Prop name | Feature Name
<row> Owner name | Owner Extcode | Prop name | Feature Name
<row> Owner name | Owner Extcode | Prop name | Feature Name

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文