一个。CreditCard belongs_to_ User一个Subscription也belong_to User。
我正在尝试查询所有CreditCardsbelong_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
where Subscription.status = "authorized"给我missing FROM-clause entry for table "subscription"
我究竟做错了什么?