English 中文(简体)
网络2py DAL多种左翼加入
原标题:web2py DAL multiple left joins

是否可能? 我尝试如下:

rows=db().select(db.division.ALL, db.department.ALL, db.section.ALL, 
    left=db.section.on(db.department.id==db.section.department_id) & 
    db.department.on(db.division.id==db.department.division_id))

傲慢说,不支持。

最佳回答

作为清单:

left=[db.section.on(db.department.id==db.section.department_id),
      db.department.on(db.division.id==db.department.division_id)]
问题回答

暂无回答




相关问题
trrying to optimize the query

I am just trying to left join and attach all the table but remaining table seems to be same is there any other way to attach the table like function or temp table to optimize it. SELECT Business ...

Slow query - Multiple joins and a lot of data

I m sure there is a better way I could be doing this. I have three main tables with large amounts of data to run through: records_main, sales, and appointments. Each with close to 20,000 records. I ...

Is an outer join possible with Linq to Entity Framework

There are many examples of outer join using Linq to Sql, all of them hinging on DefaultIfEmpty() which is not supported with Linq to Entity Framework. Does this mean that outer join is not possible ...

MYSQL DATE function running insanely slow in LEFT JOIN

When adding the line: LEFT JOIN core_records_sales as sales ON DATE(appointments.date) = DATE(sales.date_sold) To my query, it boosts the time for the script to run from about 8 seconds, to 2-3 ...

Limiting Access by Permission

thanks for viewing this. I have a db that has users, roles & user_roles. What I am trying to achieve is a login that will select users who have Admin or Associate permissions. The login then uses ...

热门标签