我正在尝试更改此处查询的布局,以将合并搜索时间显示为一列,以便我可以按顺序在我们的网站上显示搜索。
非常感谢任何帮助。
代码:
Select
StVS.ID AS 'SessionID',
-- Search Details
StBe.Bedrooms AS 'Searches Bedrooms',
StDo.Dogs AS 'Searches Dogs',
StDu.Duration AS 'Searches Duration',
-- Search times
StBe.datetimeselected AS 'Bedrooms time',
StDo.datetimeselected AS 'Dogs time',
StDu.datetimeselected AS 'Duration time'
FROM Stats_VisitorSessions StVs
-- Searches
left join Stats_Bedrooms StBe on StBe.SessionID=StVS.SessionID
left join Stats_Dogs StDo on StDo.SessionID=StVS.SessionID
left join Stats_Duration StDu on StDu.SessionID=StVS.SessionID