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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南