By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Merge 2 integer columns into 1 seperate column in database

P: 5
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
Share this Question
Share on Google+
5 Replies

Expert Mod 10K+
P: 12,349
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

P: 5
But i need to insert the value into the tenant_id column. How should i do about?
May 20 '12 #3

Expert Mod 10K+
P: 12,349
What I'm trying to say is that you don't need a tenant id column. It repeats data unnecessarily.
May 21 '12 #4

P: 5
I understand. But im trying to say i need this column. It is a compulsory column.
May 21 '12 #5

Expert Mod 10K+
P: 12,349
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.