4

following is my code for sqlalchemy inner join. I dont want to select any column of Order table but also I need Order as my from table.

query = db.session.query(Order, Customer.first_name, Customer.cnic_no, Item.name, Item.category)
query = query.join(Customer)
result = query.join(Item)

1 Answer 1

3

Use select_from

query = db.session.query(Customer.first_name, Customer.cnic_no, Item.name, Item.category)
query = query.select_from(Order)
query = query.join(Customer)
result = query.join(Item)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.