468,541 Members | 1,740 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,541 developers. It's quick & easy.

Merge 2 integer columns into 1 seperate column in database

1st column: block_number
2nd column: unit_number

I want to merge the 2 columns and get a tenant_id column.
E.g. block_number = 12
unit_number = 1234

tenant_id = 121234
But i kept trying and get an addition of both columns which is 1246. How should i separate both of them but remain them as int instead of changing them to varchar.
May 20 '12 #1
5 2087
12,513 Expert Mod 8TB
Don't merge them. Keep them separate. You can just calculate it when needed. To do the calculation, use the append operator and not the addition operator.
May 20 '12 #2
But i need to insert the value into the tenant_id column. How should i do about?
May 20 '12 #3
12,513 Expert Mod 8TB
What I'm trying to say is that you don't need a tenant id column. It repeats data unnecessarily.
May 21 '12 #4
I understand. But im trying to say i need this column. It is a compulsory column.
May 21 '12 #5
12,513 Expert Mod 8TB
Whether or not it's compulsory, I've already answered the question in my first post.
May 21 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by =?Utf-8?B?Y2RiaWdncw==?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.