What I'd like to do is for a gaming application I need to search for my non player characters and they have a field called target_id that stores the id of whatever they are chasing.
given:
table mobs with fields and some example data
id x y target_id
1 1 1 2
2 3 3 1
I would like to return the following data with a query
id x y target_id target_x target_y
1 1 1 2 3 3
2 3 3 1 1 1
This is what I tried but it has syntax errors
SELECT id,x,y,target_id, target.x, target.y FROM mobs LEFT JOIN mobs AS target ON target_id=id FROM mobs WHERE 1