473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Merge 2 integer columns into 1 seperate column in database

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
5 2390
Rabbit
12,516 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
lollol
5
But i need to insert the value into the tenant_id column. How should i do about?
May 20 '12 #3
Rabbit
12,516 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
lollol
5
@Rabbit
I understand. But im trying to say i need this column. It is a compulsory column.
May 21 '12 #5
Rabbit
12,516 Expert Mod 8TB
Whether or not it's compulsory, I've already answered the question in my first post.
May 21 '12 #6

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

Similar topics

0
by: Carl | last post by:
Hi, I have found a way to map attributes (columns) to column headings. But this runs really slow. Is there a way to improve it? Thanks, Carl <?xml version="1.0" encoding="utf-8" ?>...
10
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
0
by: ceadtinneh | last post by:
We're running merge replication between to SQL Server 2000 servers. The application isn't very high volume the setup is pretty vanilla (ie no filters, etc). We have a push subscription set up...
0
by: Rex | last post by:
Hi I am getting this error message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user." when I am trying to connect to access...
0
by: narayan2586 | last post by:
Hi all, Currently, if someone has access to the database, they will be able to view all the tables in the database. We want to be able to set additional security for some other tables....
3
by: NewlytoSQL | last post by:
Hi all, im fairly new to SQL and im stuck half way through a query, im using DB2 here is what im tryng to do. i have a query that brings back an item number , shelf req, sum of all orders columns,...
5
by: =?Utf-8?B?Y2RiaWdncw==?= | last post by:
Hi, I've been tasked to write a windows app that allows people to enter transactions. For each transaction, there can be an unknown number of items, and as a person enters an item, the program...
1
by: spowel4 | last post by:
Is it possible to have a listview with multiple columns but only the last column is checked? In other words none of the other columns would have checkboxes.
1
by: monkey0525 | last post by:
As the title of the question states, my program is not able to store an integer from a seperate text file provided. For instance, instead of printing the desired output: "$45.00 17 2222 Chuck...
0
by: spanchethan | last post by:
actually i map jboss with pidgin database server ,when i want to fetch columns from table it throwing error message ,my actuall java code is switch (tml.getF()) { case FeatureCodes.PICTURE_US:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.