duplicate with join 2 table

0

Hi everyone,
I have a problem when join two table. Both of them have format 2 columns is 'nid'; 'tid'
When I join them I have some unexpected data

the first table I have
nid | tid
4 | 0
5 | 5

the second table I have
nid | tid
4 | 7
5 | 5
6 | 5

The result
nid | tid
0 | 4 ( THIS IS THE ONE UNEXPECTED)
4 | 0
4 | 7
5 | 5
5 | 5
6 | 5

My code is
SELECT * FROM
(SELECT
id_city_test.nid,
id_city_test.tid
FROM
id_city_test)
AS a

UNION

SELECT * FROM
(SELECT
id_industry_test.nid ,
id_industry_test.tid
FROM
id_industry_test)
AS b

Can someone help me.
Thanks a lot
Thang

질문됨 5년 전168회 조회
1개 답변
0

Magically the problem is solved itself with the previous code this time so I close the topic

답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠