mini cooper加几号汽油# Automobile - 车轮上的传奇
l*9
1 楼
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.
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.