当前位置:网站首页>How to perform multi table associated query on Citrix SQL data
How to perform multi table associated query on Citrix SQL data
2022-04-22 13:32:00 【51CTO Deng Peng】
In addition to DDC Check the relevant information of the login user on the console , We can also go through Citrix Connected SQL Database to view . Check through the database , You can see more information .
Here is an example of a multi table query case .
-- Query user history session information
SELECT top
(
20
)
c
.Clientname Client name
,
c
.ClientAddress client IP Address
,
m
.Name
AS VDI desktop
,
u
.UserName
AS user name
,
c
.Protocol agreement
,
c
.IsReconnect
,
s
.startDate
AS SessionStartdate
,
c
.logonenddate
,
c
.disconnectdate
,
s
.enddate
AS SessionEndDate
,
c
.sessionkey
FROM
[CitrixRofficeMonitoring
].
[MonitorData
].
[Connection
]
AS
[c
]
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[Session
]
AS
[s
]
ON s
.SessionKey
= c
.SessionKey
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[Machine
]
AS
[m
]
ON s
.MachineId
= m
.Id
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[User
]
AS
[u
]
ON s
.UserId
= u
.Id
WHERE c
.Protocol
=
'HDX'
AND u
.UserName
=
'dengpeng'
and m
.Name
is
not
null
ORDER
BY S
.StartDate
DESC
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
Make another comment below
-- Query user history session information
SELECT top
(
20
) ## The following indicates the parameters to be queried and displayed
c
.Clientname Client name
, ## Display client name , Alias is client name
c
.ClientAddress client IP Address
,
m
.Name
AS VDI desktop
,
u
.UserName
AS user name
,
c
.Protocol agreement
,
c
.IsReconnect
,
s
.startDate
AS SessionStartdate
,
c
.logonenddate
,
c
.disconnectdate
,
s
.enddate
AS SessionEndDate
,
c
.sessionkey ### Add whatever you need to query , Note that the last line displayed does not need punctuation , Press the database alias , The search box will pop up automatically
FROM ## Perform an associated query on multiple tables ,LEFT Represents the left connection , The display is subject to the left
[CitrixRofficeMonitoring
].
[MonitorData
].
[Connection
]
AS
[c
] ## The database alias is c, Here we need to pay attention to , Please replace with the actual database name and query .
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[Session
]
AS
[s
]
ON s
.SessionKey
= c
.SessionKey ## The database alias is s c Connect to s surface
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[Machine
]
AS
[m
]
ON s
.MachineId
= m
.Id ## The database alias is m
LEFT
JOIN
[CitrixRofficeMonitoring
].
[MonitorData
].
[User
]
AS
[u
]
ON s
.UserId
= u
.Id #### The database alias is u
--WHERE c.Protocol='HDX'## Filter connection protocols AND u.UserName='dengpeng'## Filter user name and m.Name is not null
ORDER
BY S
.StartDate
DESC
Notice that the code is preceded by
-- For comments
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
Here's the picture , use SQL After the client connects to the database , New query , Press Ctrl+F Key to query and replace with the actual database name


版权声明
本文为[51CTO Deng Peng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221135475931.html
边栏推荐
猜你喜欢
随机推荐
Redis(主从复制、哨兵模式、集群)概述及部署
Harbor v2.5更新,都增加了哪些功能?
【直播来袭】OneOS系统教程全面上线,邀您和ST、OneOS一起来学习啦!
B站砍向直播,迟早的事
Pm4py - analyze what BPMN can be converted into process tree
How to become an open source database developer?
Redisconfig configuration class
托宾Q数据-沪深A股上市公司(含行业名称、代码等指标)2003-2020
The vscode database calls the stored procedure and unrecognized data appears
linux下redis6.详细安装
mysql FUNCTION xxx. CHARINDEX does not exist
Panel data of provincial innovation capacity - including multi index data such as number of patents and turnover (2008-2019)
MapReduce案例—分别通过Reduce端和Map端实现JOIN操作
MySQL DNS解析和主机缓存
Stm32cubemx redirects printf output to serial port
Measurement and driving factors of China's digital economy - informatization degree measurement index (2013-2020)
销量大腰斩,岚图无蓝图
XML外部实体攻击原理以及实战(XXE)(1)
Panel data of green total factor productivity of gtfp in all provinces (2004-2018)
难得盈利或是昙花一现,达芙妮学不会南极人








