我有这个查询生成自定义生成的ID,但我认为这是不正确的请帮助我
SELECT CONCAT('STUDENT-',COUNT(Id), + 1) FROM `students`;
从学生中选择'STUDENT-'+ CAST(newid()as varchar(50))
像这样更改您的查询
SELECT 'STUDENT-' + CAST(COUNT(1) + 1 AS VARCHAR(20)) FROM Students