本文介绍了如何在sql中创建自动生成的quatation数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 如何在sql中创建自动生成的quatation数字 i在sql中创建了一个表,但是这个表如何生成一个quatation数,每次插入一个quatation号码创建 请帮助我任何人how to create a auto generated quatation number in sqli have created one table in sql but this table how to genrated a quatation number, each time insert one quatation number createdpls help me anybody推荐答案create table CP2(QuoteNo int IDENTITY(10001,1),SomeOtherData varchar(max))insert into CP2 values('item 1'),('item 2'),('item 3')这将自动生成 QuoteNo 值:10001item 110002item 210003item 3你想要你的特殊格式 - 所以在显示点格式化它们,例如You want yours in a particular format - so format them at the point of display e.g.SELECT 'QU-' + CAST(QuoteNo as varchar)from CP2QU-10001QU-10002QU-10003 这篇关于如何在sql中创建自动生成的quatation数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!