0
我有两个表和一个查询,我想输出不同ID的文本。SQL查询不正确
col1和表A的是Col2中一个外键表的PK乙
Table A
PK Col1 Col2
1 2 3
Table B
PK Col1
2 test
3 test1
查询:
select 'This is a ' + B.Col1 + 'and this is' + B.Col1 from TableA r inner join TableB k on r.Col1 = k.PK
内上r.Col2 = t.PK”
加入表B吨结果我想
This is a test and this is test1
结果即时得到
This is a test and this is test