我正在尝试根据一组用户的 id 在另一个表中存储的数组中选择他们的所有纬度和经度。这是我的尝试:
SELECT latitude, longitude
FROM userloc WHERE id = ANY( SELECT interested FROM donedeals WHERE deals_id=67);
Run Code Online (Sandbox Code Playgroud)
但它给了我以下错误:
ERROR: operator does not exist: integer = integer[]
LINE 1: SELECT latitude, longitude FROM userloc WHERE id = ANY( SELE...
^
HINT: No operator matches the given name and argument type(s).
You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)
donedeals有一int列 fordeals_id和一int array列 for interested,其中包含与 的 id 列对应的 id userloc,该列存储纬度和经度:
deals_id | interested …Run Code Online (Sandbox Code Playgroud)