0

嗨,我正在尝试从数据库中选择两个 id,第二个我想将文本添加到结果中。

SELECT
   A.PractitionerId,
   'http://www.icuro.co.za/WebForms/Members/Appointments/AppointmentView.aspx?id=' + CAST(A.AppointmentId)
FROM
   Appointment AS A WITH (NOLOCK)

我将如何实现这一目标?

提前致谢。

4

1 回答 1

4

你快到了,你需要告诉Cast什么要投射为:

SELECT
   A.PractitionerId,
   'http://www.icuro.co.za/WebForms/Members/Appointments/AppointmentView.aspx?id=' + CAST(A.AppointmentId as varchar(50))
FROM
   Appointment AS A WITH (NOLOCK)
于 2013-08-30T09:15:34.867 回答