请帮忙,我一点也不擅长 SQL,但我创建了下面的查询。它从房间预订系统中提取信息以显示在数字标牌产品上。
目前,“名称”字段输出为lastname, firstname
. 我真的需要它显示为Firstname Lastname
但仍在一列下。
有人可以看看吗?这将不胜感激。
SELECT
HOST9006.DESCRIPTION,
HOST0110.ROOMNAME,
HOST0140.NAME,
dateadd(mi, HOST0120.STARTMINS, HOST0120.MTGDATE) AS ASTART,
dateadd(mi, HOST0120.ENDMINS, HOST0120.MTGDATE) AS AFINISH,
CONVERT(VARCHAR(5), dateadd(mi, HOST0120.STARTMINS, HOST0120.MTGDATE) ,108) AS START,
CONVERT(VARCHAR(5), dateadd(mi, HOST0120.ENDMINS, HOST0120.MTGDATE) ,108) AS FINISH,
HOST0120.MTGKEY, HOST0120.HIPTYPE, HOST0120.ROOMKEY
FROM
HOST0140
INNER JOIN HOST0120
ON HOST0120.OWNERKEY=HOST0140.PERSONKEY
INNER JOIN HOST9006
ON HOST9006.KEYVALUE=HOST0120.MTGSTATE
INNER JOIN HOST0110
ON HOST0110.ROOMKEY=HOST0120.ROOMKEY
WHERE
CANCELSTATE='0'
AND MTGDATE >= DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
AND MTGDATE < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 1)
AND MTGSTATE <> '11'
ORDER BY START
谢谢