You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT"t1"."id", "t1"."permission_id", "t1"."group_id", "t5"."name", "t4"."primary_key", "t4"."name", "t4"."company_id", "t4"."app_account_id"FROM"permissioningroup"AS t1
INNER JOIN"group"AS t4 ON ("t1"."group_id"="t4"."primary_key")
INNER JOIN"useringroup"AS t2 ON ("t4"."primary_key"="t2"."group_id")
INNER JOIN"user"AS t3 ON ("t2"."user_id"="t3"."ID")
WHERE ((("t4"."app_account_id"= ?) AND ("t4"."company_id"= ?)) AND ("t3"."ID"= ?))
[722, 25, 32]
I will have this exception while trying to iterate over it
peewee.OperationalError: nosuchcolumn: t5.name
But this one works.
(PermissionInGroup
.select(PermissionInGroup, Permission, Group)
.join(Group)
.where(Group.app_account==app_account_id,
Group.company_id==company_id)
.join(UserInGroup)
.join(User)
.where(User.ID==user_id)
####### mark the difference
.switch(PermissionInGroup)
.join(Permission)
.order_by(Permission.name)
#######
)
SQL statement
SELECT"t1"."id", "t1"."permission_id", "t1"."group_id", "t5"."name", "t4"."primary_key", "t4"."name", "t4"."company_id", "t4"."app_account_id"FROM"permissioningroup"AS t1
INNER JOIN"group"AS t4 ON ("t1"."group_id"="t4"."primary_key")
####### mark the differenceINNER JOIN"permission"AS t5 ON ("t1"."permission_id"="t5"."name")
#######INNER JOIN"useringroup"AS t2 ON ("t4"."primary_key"="t2"."group_id")
INNER JOIN"user"AS t3 ON ("t2"."user_id"="t3"."ID")
WHERE ((("t4"."app_account_id"= ?) AND ("t4"."company_id"= ?)) AND ("t3"."ID"= ?))
####### mark the differenceORDER BY"t5"."name"#######
[722, 25, 32]
Can I have a better way to do this query?
I don't need to do order_by.
The text was updated successfully, but these errors were encountered:
The following query does not work.
SQL statement would be like
I will have this exception while trying to iterate over it
But this one works.
SQL statement
Can I have a better way to do this query?
I don't need to do
order_by
.The text was updated successfully, but these errors were encountered: