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 |
|
lovehui
Yak Posting Veteran
60 Posts |
Posted - 2009-03-27 : 14:43:39
|
Suppose I have two tables A and B.There are no common fields except the followingTable AUS DollarCheck Table BUS Dollar ReasonCheck Reason May I join them by manipulating strings?Thanks |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-27 : 14:54:20
|
| you can. |
 |
|
|
lovehui
Yak Posting Veteran
60 Posts |
Posted - 2009-03-27 : 14:55:49
|
| But I don't know how?Can anyone contribute a piece of code? |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-27 : 15:00:43
|
| [code]Gocreate table #TableA (col1 varchar(100))Goinsert into #TableAselect 'US Dollar' union allselect 'Check'Gocreate table #TableB (col1 varchar(100))Goinsert into #TableBselect 'US Dollar Reason' union allselect 'Check Reason'select * from #TableA a join #Tableb b on a.col1=replace(b.col1,'Reason','')[/code] |
 |
|
|
|
|
|