| Author |
Topic |
|
luckycsc
Starting Member
7 Posts |
Posted - 2009-02-12 : 10:53:04
|
| Hello All,Can anyone please help me out with this.I have a column called Institution_name in a table Institution in a database named "INS"This column looks likeInstitution_NameColumbiaHarvardBerkleyI have another column called Roles in a table USER_ROLES in a database named "RLS"This column loooks likeRolesMasterStudentProfessorI want to merge these two columns into one....and name the resulting column as XYZ and it should look likeXYZColumbia:MasterHarvard:StudentBerkeley:ProfessorCan anyone please help me out how would this be possible. I guess there should be something called "CONCAT" command, but I am not sure how that works for joining columns in different databasesTHANKS A LOT!!!!Arjun |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 10:56:08
|
| also didnt you still understand how to do this? you already posted solution there |
 |
|
|
luckycsc
Starting Member
7 Posts |
Posted - 2009-02-12 : 10:59:04
|
| I guess this is a sql statement for which I was looking. The solution I posted there was for joining two columns from the same table in a database...this is joining two columns from tables of different databses...Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 11:01:10
|
quote: Originally posted by luckycsc I guess this is a sql statement for which I was looking. The solution I posted there was for joining two columns from the same table in a database...this is joining two columns from tables of different databses...Thanks
it may be sql staement that you want. but this forum is for MS SQL Server only, so solutions provided here will be only be according to MS SQL Server syntax. If you're using any other RDBMS like oracle, these solutions wont necessarily work |
 |
|
|
luckycsc
Starting Member
7 Posts |
Posted - 2009-02-12 : 11:04:05
|
| I am using My SQL only, not Oracle.... |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-12 : 11:06:02
|
| My SQL and SQL Server are 2 different RDBMS. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 11:07:37
|
quote: Originally posted by luckycsc I am using My SQL only, not Oracle....
This is not MySQL but MS SQL Server forum |
 |
|
|
luckycsc
Starting Member
7 Posts |
Posted - 2009-02-12 : 11:08:11
|
| Yes, but the sql can be the same.....I am looking for SQL queryto merge the columns, either SQL Server or MYSQL is fine....Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 11:21:53
|
| even in that case you should have a column on each table by which rows are related. or else how will you deterime which row of one table should be merged with which. keep in mind that you dont have concept of position in sql server unless you specify it based on unique valued column. |
 |
|
|
luckycsc
Starting Member
7 Posts |
Posted - 2009-02-13 : 11:56:42
|
| Thanks a lot to all of you....I got the solution, In SQL Server also this can be done by using CONCAT Operator.....jusrt you need to mention databasename.tablename at the endThanks |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-13 : 21:09:42
|
quote: Originally posted by luckycsc Thanks a lot to all of you....I got the solution, In SQL Server also this can be done by using CONCAT Operator.....jusrt you need to mention databasename.tablename at the endThanks
Never heard of CONCAT operator in SQL Server. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-14 : 00:53:11
|
| concat operator is + in SQL Server |
 |
|
|
|