Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kiddoOnSQL
Starting Member
16 Posts |
Posted - 2010-05-10 : 03:45:27
|
| helloI have 2 views whose data is derived from 2 seperate tables.View 1 has the foll columns:CodeQualificationsView 2 has the foll columns:CodeSoftware KnownNow I need to create 3rd view called Skills, which essentially has to combine the values in the Qualifications column of view 1 and Software Known column of view 2, INTO the 'Skills Acquired' column of View 3. View 3 will also have the column 'Code' which is a common link between all 3 views.Is this this possible? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-10 : 04:05:48
|
| create view view3asselect v1.code,v1.Qualifications+' '+v2.[Software Known] from view1 as v1 inner join view2 as v2on v1.code=v2.codeMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-05-10 : 13:16:34
|
| [code]create view view3asselect v1.code,coalesce(v1.Qualifications,'')+ coalesce(' '+v2.[Software Known],'') from view1 as v1 inner join view2 as v2on v1.code=v2.code[/code]if columns are nullable------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
kiddoOnSQL
Starting Member
16 Posts |
Posted - 2010-05-10 : 20:06:40
|
| Thanks guys, it worked. I just had to make one change, ie specifiy a column name after concatenating qualifications + software known:create view view3asselect v1.code,v1.Qualifications+' '+v2.[Software Known] AS SKILL from view1 as v1 inner join view2 as v2on v1.code=v2.code |
 |
|
|
|
|
|