【发布时间】:2021-07-02 13:13:42
【问题描述】:
CreditCardbelongs_toUser。 Subscription 和 belong_to User。
我正在尝试查询所有CreditCards belong_to 和User 其中Subscription.status 是"authorized"
select * from credit_cards
join users on users.id = credit_cards.user_id
join subscriptions on users.id = subscriptions.user_id
where subscriptions.status = "authorized"
返回ERROR: column "authorized" does not exist
其中 Subscription.status = "authorized" 给了我missing FROM-clause entry for table "subscription"
我做错了什么?
【问题讨论】:
标签: sql database postgresql