由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - generate unique integer ID from columns in SQL table (转载
相关主题
python数据处理的一个问题我的DBA在生成ORACLE table的时候需要一个一个column看 (转载)
mySQL 问题有人做quantum computing system吗?
自动化编程问题请教Java 的算法题:怎样把missing value替换成0 放在新生成的2D array里面?
问个c++问题How to read binary(data) file generated by Fortran in C/C++ (转载)
[合集] c++ parameter reflectionCODING QUESTIONS
C++ 两个project enum value名冲突问一道面试题
Small question about algorithm[合集] 和大家再讨论一道面试算法题(MS) (转载)
请问个老的COMBINATION题[合集] how to answer this question
相关话题的讨论汇总
话题: value1话题: value话题: value4话题: integer话题: id1
进入Programming版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: generate unique integer ID from columns in SQL table
发信站: BBS 未名空间站 (Fri Nov 14 17:36:46 2014, 美东)
I need to generate a new column in a table in a sql database.
the given table is:
id1 value1 value2 value3 value4
9465 387 801 1990 20
All columns are integer. All columns are integer. value1 and value2 are
always 3 digits, value3 are year value, value4 is not more than 3 digits.
I need to generate a value by combining value1 to value4, suppose that it is
called "value_combine". The "value_combine" should be unique. For example,
given the different combinations of value1 to value4, the "value_combine"
should also be different.
And then, the "value_combine" is combined with id1 such that the new value (
we call it final_id) should be unique.
For example, given different combinations of id1 and value_combine, the
final_id should also be different.
The final_id can be used to identify each unique combination of id1 and
value1-4.
The final_id MUST be integer and all values should have the same length of
digits, such as 6, 7 or 8 digits.
Any help would be appreciated.
1 (共1页)
进入Programming版参与讨论
相关主题
[合集] how to answer this question[合集] c++ parameter reflection
怎样遍历一个字母的组合 (转载)C++ 两个project enum value名冲突
请人帮忙,写网页Small question about algorithm
C++ Q74: How to return a combination of a class A object, a (转载)请问个老的COMBINATION题
python数据处理的一个问题我的DBA在生成ORACLE table的时候需要一个一个column看 (转载)
mySQL 问题有人做quantum computing system吗?
自动化编程问题请教Java 的算法题:怎样把missing value替换成0 放在新生成的2D array里面?
问个c++问题How to read binary(data) file generated by Fortran in C/C++ (转载)
相关话题的讨论汇总
话题: value1话题: value话题: value4话题: integer话题: id1