我想显示表格最后一行的旁边。
编辑:忘了ctr_no不是int
select ctr_no from request_table where req_no = (select max(req_no) from request_table);
答案 0 :(得分:0)
使用这样的子查询(未经测试;需要2012或更高版本):
select top 1 'ctr_' + convert(try_parse(substring(ctr_no,3,4) as int) as nvarchar(7)) from request_table where req_no = (select max(req_no) from request_table);