是否可以让 SQL Server 转换一组结果中的条目列
我有以下设置...
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你见过这个吗? 将行转换为列的五种方法
Have you seen this? Five methods converting rows to columns