I have two table like this
table "X"
idX(pk) contentX(char)
10 foo1
21 foo2
34 foo3
45 foo4
table "Y"
idY(pk) contentY(char)
11 boo1
22 boo2
33 boo3
40 boo4
And after joining, intsert to a table and become this
idNew(pk) idX(UQ) content(char) idY(UQ) content(char)
1 10 foo1 11 boo1
2 21 foo2 22 boo2
3 34 foo3 33 boo3
4 45 foo4 40 boo4
The SQL I use is like this
INSERT INTO DataBase.newtable(idX, contentX,idY,contentY)
SELECT X.idX, Y.idY, contentX, contentY
FROM DataBase.X, DataBase.Y, ;
But the SQL statement cannot insert to newtable because the idX and idY is needed to be unique value. What can I do?