我有这样的查询
SELECT "sq0"."_backward_relation_key","team"."name","team"."id"
FROM "team"
JOIN (SELECT "event_id" "_backward_relation_key","team_id" "_forward_relation_key" FROM "event_team" WHERE "event_id" IN (2))
"sq0" ON "sq0"."_forward_relation_key"="team"."id"
在postgres中,它以这种方式返回列名:
_backward_relation_key | name | id
但是在sqlite中它以这种方式返回它们
sq0 | team | team
有没有办法改变sqlite行为,使其与postgres类似,而不更改查询本身?
答案 0 :(得分:1)
否 - 仅方式可以保证列名在SQLite中是您想要使用的别名。