Coldfusion:需要帮助在每个系统的一行而不是多行上输出查询
历史记录:系统在投入生产之前已经经历了 1 - 19 种左右的状态。我需要构建一份报告,显示系统通过状态的日期和 NA(如果系统未通过状态)。
要求:报告需要看起来像这样:
System Initial Operations PIM_Assigned PIM_Complete Database Application
Server001 9/1/2011 NA 9/2/2011 NA NA 9/1/2011
Server002 9/10/2011 NA 9/5/2011 9/25/2011 NA 9/9/2011
Server003 9/21/2011 9/22/2011 NA NA 9/24/2011 NA
Server004 9/23/2011 9/19/2011 9/23/2011 9/20/2011 9/23/2011 9/1/2011
这是带有示例数据转储的查询(转储与上面不匹配 - 上面用于说明目的):
select status, convert(varchar,effectivedate,101) e, systemname from si_statushistory where systemname='SERVER052' order by e desc, history_id desc
我的查询的输出如下所示:
PSI 09/09/2011 SERVER052
Application 09/09/2011 SERVER052
Operations 09/09/2011 SERVER052
Application 07/14/2011 SERVER052
Operations 07/13/2011 SERVER052
Operations 07/13/2011 SERVER052
PSI 07/13/2011 SERVER052
PIM Assigned 06/08/2011 SERVER052
PSI 06/08/2011 SERVER052
SD_Verify 01/15/2012 SERVER052
PSI Operations 01/08/2012 SERVER052
Frame Team 01/01/2011 SERVER052
一行的示例看起来像:
something is missing here
我希望这是清楚且有意义的...
该页面是使用 Coldfusion 显示的,如果这使得它更容易构建,我足以使用数组和结构。关键时刻,这就是我寻求帮助的原因。我可以做到这一点,但我迟早需要它。
HISTORY: A system has passed through 1 - 19 or so statuses before being moved to production. I need to build a report showing the date the system passed through a status and NA if the system did not pass through a status.
REQUIREMENTS: The report needs to look something like this:
System Initial Operations PIM_Assigned PIM_Complete Database Application
Server001 9/1/2011 NA 9/2/2011 NA NA 9/1/2011
Server002 9/10/2011 NA 9/5/2011 9/25/2011 NA 9/9/2011
Server003 9/21/2011 9/22/2011 NA NA 9/24/2011 NA
Server004 9/23/2011 9/19/2011 9/23/2011 9/20/2011 9/23/2011 9/1/2011
Here is the query with a sample data dump following (dump does not match above - the above is for illustration purposes):
select status, convert(varchar,effectivedate,101) e, systemname from si_statushistory where systemname='SERVER052' order by e desc, history_id desc
with output from my query looking like this:
PSI 09/09/2011 SERVER052
Application 09/09/2011 SERVER052
Operations 09/09/2011 SERVER052
Application 07/14/2011 SERVER052
Operations 07/13/2011 SERVER052
Operations 07/13/2011 SERVER052
PSI 07/13/2011 SERVER052
PIM Assigned 06/08/2011 SERVER052
PSI 06/08/2011 SERVER052
SD_Verify 01/15/2012 SERVER052
PSI Operations 01/08/2012 SERVER052
Frame Team 01/01/2011 SERVER052
Example of what ONE row would look like:
something is missing here
I hope this is clear and makes sense...
The page is being displayed using Coldfusion and I'm adequate with using Arrays and Structures if that makes this easier to build out. Time of of the essence which is why I'm reaching out for some help. I could do this but I need it sooner than later.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在,您的 ColdFusion 只需要执行存储过程
dbo.ReturnPivotedSystemInfo
,从那里开始,它的行为应该就像您调用了SELECT * FROM sometable
...Now your ColdFusion just needs to execute the stored procedure
dbo.ReturnPivotedSystemInfo
and from there on it should be able to behave just as if you had calledSELECT * FROM sometable
...