For example:
Table A Table B Table C
SN1 contect1 Sn2 conect2 help
1. Hello. 1. Yes. Hello./very good./General./Yes./indeed./Yes./hello.
2. Good. + 2. How are you doing?
3 General situation
4. Yes.
5 is really good
That is to say, the content of the conect field in a and B is combined into the help field in Table C and displayed in text form.
-- Xiaoliang:
Declare @ Re varchar (8000 );
Set @ Re = '';
Select
@ Re = @ Re + contect1 + '/'
From DNT
Select
@ Re = @ Re + conect2 + '/'
From TBB
Set @ Re = left (@ Re, Len (@ Re)-1 );
Select @ Re
-- Old d
Create Table A (SN1 int, contect1 varchar (10 ))
Create Table B (Sn2 int, contect2 varchar (10 ))
Insert into a values (1, '')
Insert into a values (2, 'good') insert into a values (3, 'General situation ')
Insert into a values (4, 'Yes ')
Insert into a values (5, 'Really good ')
Insert into B values (1, 'true ')
Insert into B values (2, 'Hello ')
Go
Declare @ output1 varchar (8000)
Select @ output1 = coalesce (@ output1 + '/', '') + contect1 from
Declare @ output2 varchar (8000)
Select @ output2 = coalesce (@ output2 + '/', '') + contect2 from B
Print @ output1 + '/' + @ output2
Drop Table A, B
/*
Hello/very good/General/yes/indeed good/Yes/Hello
*/