如何将sql查询转换为typeorm查询生成器?

时间:2020-08-20 19:09:33

标签: sql node.js postgresql postgis typeorm

用户将提供用户名和半径。

select username
    , ST_Distance(u.location, me.location) as distance  
from users as u
    , lateral(select id
                  , location 
              from users 
              where username=username) as me
where u.id <> me.id 
    and ST_Distance(u.location, me.location) < radius 
order by distance;

0 个答案:

没有答案
相关问题