您好我正在尝试从数据库中选择两个ID,第二个我希望将文本添加到结果中。
SELECT
A.PractitionerId,
'http://www.icuro.co.za/WebForms/Members/Appointments/AppointmentView.aspx?id=' + CAST(A.AppointmentId)
FROM
Appointment AS A WITH (NOLOCK)
我将如何实现这一目标?
提前致谢。
答案 0 :(得分: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)