I am trying to make a CROSS JOIN between "Selected" columns in two tables,
For example : Table 1 (a, b, c) -- Table 2 (a, b, d)
I want to select a
and b
from each table and then join them, but I keep getting this error :
Every derived table must have its own alias
I know this is because I need to name any derived table, but I still can't figure what's the problem and how to fix it even after searching online. This is the query :
SELECT (x.targetNumber, x.name, x.lat, x.lng)
FROM ((SELECT (u.name, u.targetNumber, u.password)
FROM Users AS u WHERE 'target' = u.type)
CROSS JOIN
(SELECT (l.targetNumber, l.password, l.lat, l.lng) FROM Location AS l)
WHERE (u.targetNumber = l.targetNumber AND u.password = l.password )) AS x;