請幫忙,我一點都不擅長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
感謝
給你的問題一個**有意義的標題 – abatishchev
你正在使用哪種RDBMS? – fancyPants