| Author |
Topic |
|
aberli
Starting Member
5 Posts |
Posted - 2004-11-08 : 16:10:38
|
| Hello everyone. I have a table with 4 columns: Domain, LANID, Employee and Facility. I need to combine Domain(US/) with LANID(KEAFB22), resulting in US\KEAFB22. I also need to combine Employee with Facility but will be able to figure that one out with your help on the first one. Thank you very much!Thanks,Aberli |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-11-08 : 16:27:03
|
| SELECT Domain + '\' + LANIDFROM Table1Tara |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-11-08 : 16:29:11
|
| If the blighters allow NULLs then you might need to widen this toSELECT COALESCE(Domain, '') + '\' + COALESCE(LANID, '')FROM Table1Kristen |
 |
|
|
aberli
Starting Member
5 Posts |
Posted - 2004-11-08 : 17:01:58
|
| I'm hoping this will change the table before I export it to a .csv file. You're awesome! |
 |
|
|
aberli
Starting Member
5 Posts |
Posted - 2004-11-08 : 17:02:57
|
| The "/" is already in Domain. So, will this change the table like I want it to? Thanks!Thanks,Aberli |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-11-08 : 17:07:40
|
| SELECT COALESCE(Domain, '') + COALESCE(LANID, '')FROM Table1The query isn't going to change the table though. It just creates a result set containing how you want the data to look like. To update the table, you'll need to use UPDATE statement.Tara |
 |
|
|
aberli
Starting Member
5 Posts |
Posted - 2004-11-08 : 17:15:12
|
| Then I'll change the statement to: SELECT UPDATE(Domain, '') + UPDATE(LANID, '')???????????????????Thanks,Aberli |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-11-08 : 17:18:28
|
| UPDATE Table1SET WhateverColumnIsGettingThisChange = COALESCE(Domain, '') + COALESCE(LANID, '')But please run this on a test system first to make sure you are getting the correct results.Tara |
 |
|
|
aberli
Starting Member
5 Posts |
Posted - 2004-11-08 : 17:29:02
|
| It worked! You are a true warrior and a princess. Thank you and thank you Kristen as well. Should you ever need help with WebTrends, let me know. Cheers from Chicago.Thanks,Aberli |
 |
|
|
|